Page 1 of 1

check_dns -q mx

Posted: Fri Oct 06, 2017 2:53 am
by Hans van Leeuwen
Hi Nagios-plugin support engineer,

The command below works correct:
nslookup -querytype=MX google.com

But check_dns give an error message:
/usr/local/nagios/libexec/check_dns -H google.com -q mx
DNS CRITICAL - query type of -querytype=MX was not found for google.com

What is wrong in the check_dns command?

The version of check_dns is v2.1.1

Re: check_dns -q mx

Posted: Fri Oct 06, 2017 6:57 am
by metaldad
You should update to a newer version (current version is 2.2.1). It seems they fixed some bugs in the last two years. And the current version works:

Code: Select all

/usr/local/nagios/libexec$ ./check_dns -H google.com -q mx
DNS OK: 0,012 seconds response time. google.com returns 10 aspmx.l.google.com.,20 alt1.aspmx.l.google.com.,30 alt2.aspmx.l.google.com.,40 alt3.aspmx.l.google.com.,50 alt4.aspmx.l.google.com.|time=0,012469s;;;0,000000

Re: check_dns -q mx

Posted: Fri Oct 06, 2017 8:25 am
by Hans van Leeuwen
I have downloaded, compiled en tested the Nagios plugins V2.2.1.
Indeed it works correct.
$ check_dns -H google.com -q mx
DNS OK: 0.190 seconds response time. google.com returns 10 aspmx.l.google.com.,20 alt1.aspmx.l.google.com.,30 alt2.aspmx.l.google.com.,40 alt3.aspmx.l.google.com.,50 alt4.aspmx.l.google.com.|time=0.190218s;;;0.000000

Thanks

Re: check_dns -q mx

Posted: Fri Oct 06, 2017 10:08 am
by kyang
Thanks @metaldad!

@Hans van Leeuwen, Did you have any more questions or are we okay to close this thread?

Re: check_dns -q mx

Posted: Fri Oct 06, 2017 10:29 am
by scottwilkerson
Hans van Leeuwen wrote:I have downloaded, compiled en tested the Nagios plugins V2.2.1.
Indeed it works correct.
$ check_dns -H google.com -q mx
DNS OK: 0.190 seconds response time. google.com returns 10 aspmx.l.google.com.,20 alt1.aspmx.l.google.com.,30 alt2.aspmx.l.google.com.,40 alt3.aspmx.l.google.com.,50 alt4.aspmx.l.google.com.|time=0.190218s;;;0.000000

Thanks
Glad to see this is working for you. Let us know if you have other troubles.