Incorrect report

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Incorrect report

Post by tmcdonald »

What exact check_dns command are you using? What is the output?
Former Nagios employee
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Incorrect report

Post by lmiltchev »

The order matters, that's why if your IPs are not in the correct order, the check will return "CRITICAL".

Example:

Code: Select all

[root@testbox libexec]# nslookup amazon.com
Server:         192.168.5.2
Address:        192.168.5.2#53

Non-authoritative answer:
Name:   amazon.com
Address: 72.21.194.212
Name:   amazon.com
Address: 72.21.215.232
Name:   amazon.com
Address: 176.32.98.166
Name:   amazon.com
Address: 205.251.242.54

Code: Select all

[root@testbox libexec]# ./check_dns -H amazon.com
DNS OK: 0.006 seconds response time. amazon.com returns 176.32.98.166,205.251.242.54,72.21.194.212,72.21.215.232|time=0.006434s;;;0.000000
If I use the same order, the check returns "OK":

Code: Select all

[root@testbox libexec]# ./check_dns -H amazon.com -a 176.32.98.166,205.251.242.54,72.21.194.212,72.21.215.232
DNS OK: 0.006 seconds response time. amazon.com returns 176.32.98.166,205.251.242.54,72.21.194.212,72.21.215.232|time=0.005897s;;;0.000000
But if I swap the IPs, I get "CRITICAL":

Code: Select all

[root@testbox libexec]# ./check_dns -H amazon.com -a 72.21.215.232,176.32.98.166,205.251.242.54,72.21.194.212
DNS CRITICAL - expected '72.21.215.232,176.32.98.166,205.251.242.54,72.21.194.212' but got '176.32.98.166,205.251.242.54,72.21.194.212,72.21.215.232'
Be sure to check out our Knowledgebase for helpful articles and solutions!
chitrangada
Posts: 32
Joined: Sat Aug 10, 2013 8:20 am

Re: Incorrect report

Post by chitrangada »

Okay..! Now i understand how it works and will use it accordingly. Now if you want you can close the topic.
Thanks for sharing useful information. :)
Locked