check_dns and MX

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
tecnalb
Posts: 133
Joined: Tue May 03, 2011 12:53 pm

check_dns and MX

Post by tecnalb »

I was trying to setup a check to test an MX for change... essentially was waiting for a change to take place, and thought I would put in XI so that I was alerted.

check on my NXI server I did this:

check_dns -H <domain> -q MX and a valid record name is returned.


Now, if I wanted to expect a result that help says "-a" and a HOST would end with (.)

check_dns -H <domain> -q MX -a <hostname>.

I get "CRITICAL - Plugin timed out while executing system call" after about 15 seconds.


So then I place in a bogus hostname after the "-a"

check_dns -H <domain> -q MX -a goob.blahblah.com.

I get "check_dns: Invalid hostname/address - GOob.blahblah.com." , and also notice the first two characters get capitalized in the result.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_dns and MX

Post by abrist »

What version of check_dns are you running?

Code: Select all

check_dns -V
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.
tecnalb
Posts: 133
Joined: Tue May 03, 2011 12:53 pm

Re: check_dns and MX

Post by tecnalb »

# /usr/local/nagios/libexec/check_dns -V
check_dns v2.0.3 (nagios-plugins 2.0.3)
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: check_dns and MX

Post by jdalrymple »

Put your "-q MX" at the end of your command. Something in the -q argument parsing isn't working right when it does an uppercase function. It's turning your -a into a -A.

I'll file a bug, but that's an easy workaround.
Locked