We run a cluster of DNS resolvers which announce a VIP and a less specific route via BGP using exaBGP. This means that if one of the resolvers fails and withdraws the route to its VIP, another one takes over. There is the CHAOS TXT record which tells you the hostname of the server actually responding:
dig @<resolver ip> hostname.bind TXT CHAOS
I would like to monitor whether the correct host responds to this request for a certain VIP so that we get alerted if one of the hosts withdraws its route and another one takes over.
As far as I can tell the DNS plugin only support the IN DNS class. It there an easy way to monitor the value of a CHAOS TXT record?
Iâm aware that I could just modify the DNS plugins - however Iâd prefer not having to maintain another fork of a plugin. So what Iâm looking for is a way to monitor this without maintaining custom code.
Why not use the classic active check - âcheck_digâ it is included in the folder ~/lib/nagios/plugins/.
At the moment there is only no predefined rule set available inside CMK.
You need to define the command options by yourself with the âClassic Nagios checkâ rule.
Well it seemed a little odd to me that something called check_dns only handles A and PTR records and not all query types like you would expect from something called check_dns.
In addition as you said with the classic check you have to first know that such a check even exists and then configure it in WATO and there is no nice checkboxes just a bunch of fields that you have to fill out âblindlyâ. It is not a very good experience when compared to a native check and the ability to discover it is non-existent. Also at least for my version it is called âIntegrate Nagios Pluginsâ searching for âClassic Nagios checkâ under the Setup tab returns no results.
Simply because I didnât know it exists. Iâll give it a try, thanks! Preliminary checks on the CLI show that it should work. Iâll follow up on this one with the exact configuration as soon as I have it working in the cli.
Supporting other types alone wonât help in my case, I also need the CHAOS rather than the INTERNET class. I checked the source code: The nagios plugin uses nslookup and doesnât allow you to pass custom command line arguments to nslookup. On the other hand thatâs exactly what you can do with the check_dig plugin. This plugin also allows you to set the type. So all thatâs missing is a GUI plugin.
The nagios plugin uses nslookup and doesnât allow you to pass custom command line arguments to nslookup. On the other hand thatâs exactly what you can do with the check_dig plugin. This plugin also allows you to set the type. So all thatâs missing is a GUI plugin.
Yeah you will see my proposal was actually to support using check_dig for the active check instead of check_dns. As again it seems really silly that the âpreferredâ way inside the GUI is to use an old outdated check that doesnât support all DNS record types doubly so when check_dig is already included as a âclassic checkâ.
check_dig -l "hostname.bind" -A "-c CH -t TXT" -H $_HOSTADDRESS_6$ -a <hostname>
The only caveat was that you cannot use -T TXT but have to include -t TXT within the argument for the-A flag.
Thank you @andreas-doehler, this worked like charm! The only question now: Do I mark my post or your post as the solution? (âyou get creditâ vs. âmarking the most detailed answer as solutionâ )
Better option would be to mark Andreasâs post - when you mark your own it does not count in the system towards solutions provided.
And if the thread as a whole is marked as solved â I think it should not be too difficult to scroll down to see the full explanation
Of course the choice is always yours.