Page 1 of 1

Check_DNS false positive

Posted: Fri Mar 24, 2017 11:16 am
by SavaSC
I am having an issue with check_dns. I am needing to get an alert if a specified DNS server has hung and will not respond to requests. This should be testable by pointing the check_dns command to a non-DNS server. However, it doesn't matter if I use a DNS server IP or not, I still get that the IP is resolving.

I have attached a screenshot showing both attempts. The top attempt is pointing to a DNS server (10.96.36.19). The bottom attempt is pointing to a NON-DNS server (10.96.36.18). As you can see, both return a positive result.

The nearest thing I can figure is that the Check_DNS, after getting a fail from the supplied DNS server then moves to the DNS server list in /etc/resolve.conf. Is this the expected action of the Check_DNS service?

Thanks.

Re: Check_DNS false positive

Posted: Fri Mar 24, 2017 12:37 pm
by avandemore
It's working for me:

Code: Select all

# /usr/local/nagios/libexec/check_dns -H google.com -s 192.168.10.10
CRITICAL - Plugin timed out while executing system call
What is the output from:

Code: Select all

# dig @10.96.36.18 10.96.19.132

Re: Check_DNS false positive

Posted: Fri Mar 24, 2017 3:11 pm
by SavaSC
Result in attachment.

Re: Check_DNS false positive

Posted: Fri Mar 24, 2017 3:56 pm
by cdienger
What version of check_dns are you on? Check this with ./check_dns --help

If you're on the 2.2.0 version, run the following commands:

strace -o check_dns_trace.txt ./check_dns -H 10.90.19.132 -s 10.96.36.18
tcpdump -s 0 -i any port 52 -w check_dns_capture.pcap

Allow the tcpdump to run while you run the check_dns command a couple times, then use ctrl+c to stop the trace. Provide us with the result check_dns_trace.txt and check_dns_capture.pcap.

Re: Check_DNS false positive

Posted: Mon Mar 27, 2017 12:52 pm
by SavaSC
It is showing I am on v2.0.3. I went to gethub and tried downloading & installing the newest Advanced Nagios Plugin Collection but the date on the check_dns plugin didn't change even though the website says it was updated 3 months ago. I'm not sure what I did wrong.

Re: Check_DNS false positive

Posted: Mon Mar 27, 2017 1:17 pm
by avandemore
Where did you download it from and how exactly did you install it?

This is our repo: https://github.com/nagios-plugins/nagios-plugins

Re: Check_DNS false positive

Posted: Mon Mar 27, 2017 2:06 pm
by SavaSC
I went and downloaded the one you pointed me to (just to make sure I had the right thing). I uncompressed the Nagios-plugin-master folder into /usr/local/nagios/libexec and did the steps in the README text file. The only one that seemed to actually work was step one.

Re: Check_DNS false positive

Posted: Mon Mar 27, 2017 2:18 pm
by avandemore
I just installed from there this morning. Can you share the commands and output from your steps?

Re: Check_DNS false positive

Posted: Mon Mar 27, 2017 3:00 pm
by SavaSC
OK, apparently I lied. It doesn't even get step one done. It said it needed Autoconf version 2.60 or higher. I installed Autoconf 2.6.9 and then noticed that the permissions weren't correct on the nagios-plugins-master folder and files either. :-/ After addressing these two issues, the plugin bundle installed as it should.

Now I have tested the check_xi_service_dns command and it does seem to give a proper fail when trying to get a DNS resolution from a non-DNS server.

Thank you for your help. Everything seems to be working now.