Page 1 of 2
DNS Monitor Boolean
Posted: Wed Oct 02, 2013 2:57 pm
by jeffersjw
I want to setup a DNS monitor to monitor either/or for multiple IP addresses.
Right now I use check_xi_service_dnsquery!-H somedomain.com -a x.x.x.x -a x.x.x.x but this seems to be an AND.
Re: DNS Monitor Boolean
Posted: Thu Oct 03, 2013 9:59 am
by slansing
You may need to be using commas here instead of separate "-a" sections, here is the plugin usage:
https://www.nagios-plugins.org/doc/man/check_dns.html
Re: DNS Monitor Boolean
Posted: Thu Oct 03, 2013 12:24 pm
by jeffersjw
Worked. Thanks!
Re: DNS Monitor Boolean
Posted: Thu Oct 03, 2013 3:27 pm
by jeffersjw
It's still flapping. Does the comma mean AND? Is their a way to configure it so that it checks for one IP or the other?
We are using DNS load balancing and it seems to only resolve whatever IP the session hits at a particular point in time.
Re: DNS Monitor Boolean
Posted: Fri Oct 04, 2013 11:01 am
by sreinhardt
Just want to clarify real quick, are you looking to check against multiple servers, to make sure that they respond with the same IP, or you don't care which server you are checking against and potentially expect differing returned IPs for each server?
Re: DNS Monitor Boolean
Posted: Fri Oct 04, 2013 11:14 am
by jeffersjw
It is checking against multiple IP addresses for the same host.
I am not sure how it is done, but if it is using a DNS query similar to dig, it should return both IP addresses for the A record. For some reason it only returns one IP at a time.
Would like for it to check against both IP addresses, but for some reason it doesn't.
Re: DNS Monitor Boolean
Posted: Fri Oct 04, 2013 11:15 am
by jeffersjw
Here is the error:
DNS CRITICAL - expected 'x.x.x.253,x.x.x.214' but got 'x.x.x.253'
Re: DNS Monitor Boolean
Posted: Fri Oct 04, 2013 12:06 pm
by abrist
Lets try it without the xi wizard wrapping script:
Code: Select all
/usr/local/nagios/libexec/check_dns -H somedomain.com -a x.x.x.x -a x.x.x.x
Re: DNS Monitor Boolean
Posted: Fri Oct 04, 2013 12:54 pm
by jeffersjw
It works, but seems like it isn't returning the second IP. I will continue to monitor it to see if it returns the second one when the DNS traffic manager redirects it.
Not sure what the difference is between using a -a x.x.x.x -a x.x.x.x or -a x.x.x.x,x.x.x.x
Re: DNS Monitor Boolean
Posted: Fri Oct 04, 2013 1:17 pm
by abrist
The following is "OR":
And the following is "AND":
I tested this logic from the cli and it is correct. There may be an issue with how the $ARGn$s are configured in XI. What do you have for your $ARGn$ values in the CCM for the check?