DNS Monitor Boolean

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jeffersjw
Posts: 32
Joined: Tue Aug 27, 2013 9:29 am

DNS Monitor Boolean

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: DNS Monitor Boolean

Post 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
jeffersjw
Posts: 32
Joined: Tue Aug 27, 2013 9:29 am

Re: DNS Monitor Boolean

Post by jeffersjw »

Worked. Thanks!
jeffersjw
Posts: 32
Joined: Tue Aug 27, 2013 9:29 am

Re: DNS Monitor Boolean

Post 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.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: DNS Monitor Boolean

Post 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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
jeffersjw
Posts: 32
Joined: Tue Aug 27, 2013 9:29 am

Re: DNS Monitor Boolean

Post 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.
jeffersjw
Posts: 32
Joined: Tue Aug 27, 2013 9:29 am

Re: DNS Monitor Boolean

Post by jeffersjw »

Here is the error:

DNS CRITICAL - expected 'x.x.x.253,x.x.x.214' but got 'x.x.x.253'
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: DNS Monitor Boolean

Post 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 
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
jeffersjw
Posts: 32
Joined: Tue Aug 27, 2013 9:29 am

Re: DNS Monitor Boolean

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: DNS Monitor Boolean

Post by abrist »

The following is "OR":

Code: Select all

-a x.x.x.x -a x.x.x.x
And the following is "AND":

Code: Select all

-a x.x.x.x,x.x.x.x
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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked