I want to monitor my DNS server with Nagios. I understand there's a check_dns plugin but I'm a total Nagios noob and I have no idea how I would go about using the plugin. All I want to do is the equivalent of making sure an nslookup command succeeds. Can someone point me in the right direction?
login the nagios server with putty (windows) or slogin in a unix shell. If you login as root, become the nagios user:
Go to the /usr/local/nagios/libexec dir (assuming you have installed nagios from source, if you have used a package from your distribution, check the docs of your package):
execute the check_dns plugin with the --help switch. It will give you all the available options:
So, if you want to check that serverfault.com resolves to 69.59.196.211, yo do this:
As you can see you can also especify which DNS server to query with the -s switch, warning and critical thresholds, etc. Once you're satisfied with the check you run from the cli, you edit the nagios config file where you define the services (probably services.cfg) and apply the check to a given host(group). But that is much better documented in the fine manual you can even read from the web interface that got installed when you installed nagios.
You probably already have the command defined in your stock nagios config like so:
Mine is in
/etc/nagios/objects/commands.cfg
The most simple case is to define a service that checks the DNS server on the host:
Note that this assumes:
ns1
set up as a host alreadygeneric service
already set up with useful defaultsNagios is a pretty complicated tool, there's no really easy 'quick start'.
In order that the command looks for binary check_dns in the right place better to define it using nagios variables (default installation):
The above command checks that the server being tested returns the address 93.184.216.119 for hostname www.example.com
Run the plugin with -h and it should give you documentation on how to use it. Normal paramters include the host to test, limits for critical and warning limits. DNS test will likely include what you want to look up.