Check_dns troubleshooting


I am having some problems with the check_dns plugin. I’m trying to check the DNS service on a couple of active directory Windows servers.

Here’s the entry from command.cfg:

‘check_dns’ command definition

define command{
command_name check_dns
command_line $USER1$/check_dns -H -s $HOSTADDRESS$

And the entry from services.cfg:
define service{
use local-service
host_name UTILPRD001
service_description DNS
check_command check_dns!

The error I’m getting is:
DNS CRITICAL - ‘/usr/local/bin/nslookup -sil’ output parsing exited with no address

and nagios.log:
SERVICE ALERT: UTILPRD001;DNS;CRITICAL;HARD;4;DNS CRITICAL - ‘/usr/local/bin/nslookup -sil’ output parsing exited with no address

I checked the paths and nslookup is indeed in /usr/local/bin.

Is there a problem with my syntax?



What happens when you don’t use -s?


Same thing. I don’t think it’s that, because when I run the command by hand:

./check_dns -H

DNS OK: 0.032 seconds response time returns|time=0.031740s;;;0.000000


I see you ran that as user root. Now compare apples to apples by running it as user nagios, and you will see that user nagios can’t run it, but root can. So… it would be a permission problem. Selinux is enabled?


Hi Jakkedup,
That was it. the nagios user did not have rights to read /etc/resolv.conf. Thanks