Page 1 of 1
check_dns_pl or check_dns
Posted: Tue Apr 19, 2016 6:40 pm
by rvaede
I am trying to code a routine in Nagios to check a website dns and if the IP matches does not match IP:xx.xx.xx.xx then generate an alert.
Any suggestions? Thanks
Re: check_dns_pl or check_dns
Posted: Tue Apr 19, 2016 6:56 pm
by Box293
check_dns comes with the Nagios Plugins package:
Code: Select all
/usr/local/nagios/libexec/check_dns -H xitest.box293.local. -a 10.25.5.2
DNS OK: 0.328 seconds response time. xitest.box293.local. returns 10.25.5.2|time=0.327597s;;;0.000000
/usr/local/nagios/libexec/check_dns -H xiproduction.box293.local. -a 10.25.5.2
DNS CRITICAL - expected '10.25.5.2' but got '10.25.5.1'
Is this what you were after ?
Re: check_dns_pl or check_dns
Posted: Tue Apr 19, 2016 7:56 pm
by rvaede
Yes, well done it works perfectly. I knew there was a check_dns but I wasn't aware of the -a option.
thank you
Re: check_dns_pl or check_dns
Posted: Wed Apr 20, 2016 11:23 am
by rkennedy
Ah! Great to hear you got it working.
Going to close this one out now, but feel free to make a new thread if you require any assistance in the future.