check_dns -q mx

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.
Locked
Hans van Leeuwen
Posts: 4
Joined: Mon Jan 04, 2016 7:27 am

check_dns -q mx

Post 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
User avatar
metaldad
Posts: 3
Joined: Thu Feb 23, 2017 8:31 am
Location: Hamburg
Contact:

Re: check_dns -q mx

Post 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
Hans van Leeuwen
Posts: 4
Joined: Mon Jan 04, 2016 7:27 am

Re: check_dns -q mx

Post 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
kyang

Re: check_dns -q mx

Post by kyang »

Thanks @metaldad!

@Hans van Leeuwen, Did you have any more questions or are we okay to close this thread?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_dns -q mx

Post 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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked