How to Enable check_dns on Nagios Monitoring System

Most user who are new to Nagios doesn’t know there is a hidden plug-in called check_dns in Nagios Monitoring system. On FreeBSD server, the binary can be found at /usr/local/libexec/nagios. List the directory and you should see check_dns.

check_dns usage is as below

Try to run the command as below and you will get the query result


Sweet, that is the DNS query plugin, it does DNS query check on your DNS host server and return the query time.
Here is how to activate the monitoring, add the check_dns plug-in into Nagios’ commands.cfg configuration file.

On FreeBSD server, it’s located at /usr/local/etc/nagios/objects/commands.cfg
Edit the file commands.cfg and add the line below

  • $ARG1$ is the argument you will parse into in the configuration
  • $HOSTADDRESS$ is your host on Nagios monitoring.

Next, put the line below into service check configuration file

Restart your Nagios service now

If it’s failed, you will the red color on the monitoring status. There are a lot other plug-ins can be explore too. Have fun.