Weird behavior check_dns

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
RyanMule
Posts: 57
Joined: Tue Dec 12, 2017 3:14 pm

Weird behavior check_dns

Post by RyanMule »

Hello All,

Just recently upgraded to 5.7.5 XI from 5.6.14 and it appears to have broken my check_dns service check.
This is the command I have been using:

$USER1$/check_dns -H $HOSTADDRESS$ $ARG1$

The error I get below when using an IP
[nagios@nagios02 ~]$ /usr/local/nagios/libexec/check_dns -H 192.168.11.88
DNS CRITICAL - query type of -querytype=A was not found for 192.168.11.88

The error I get below when using hostname
[nagios@nagios02 ~]$ /usr/local/nagios/libexec/check_dns -H prodmgt01
DNS OK: 0.015 seconds response time. prodmgt01 returns 192.168.11.88|time=0.015023s;;;0.000000

How do I force it to check hostname and not IP?

Thank you
Ryan
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Weird behavior check_dns

Post by cdienger »

By default the check_dns plugin will try to resolve a hostname to an IP address. This info is stored in an 'A' record so the message you're seeing is correct.

To resolve an IP to a hostname you need the PTR record. You can make check_dns look for this record with the -q option:

Code: Select all

/usr/local/nagios/libexec/check_dns -H 192.168.11.88 -q
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
RyanMule
Posts: 57
Joined: Tue Dec 12, 2017 3:14 pm

Re: Weird behavior check_dns

Post by RyanMule »

That did the trick! added "-q PTR"

Thank you!
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Weird behavior check_dns

Post by cdienger »

Glad to hear!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked