[monitoring-plugins] check_dns: fix error detection on sles nslookup
Sven Nierlein
git at monitoring-plugins.org
Sun Mar 12 21:10:12 CET 2017
Module: monitoring-plugins
Branch: master
Commit: 9daeceaed39b04e79ba364e311e0532e4fdf711f
Author: Sven Nierlein <sven at nierlein.de>
Date: Sun Mar 12 21:02:58 2017 +0100
URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=9daecea
check_dns: fix error detection on sles nslookup
on sles (ex. 11sp1) systems the nslookup output for not found was not parsed correctly
and interpreted as ok when it should be critical:
./check_dns -H nosuchhost.nodomain -t 1 -vvv
/usr/bin/nslookup -sil nosuchhost.nodomain Server: 10.0.2.3
Address: 10.0.2.3#53
Non-authoritative answer:
*** Can't find nosuchhost.nodomain: No answer
DNS OK: 0.011 seconds response time. nosuchhost.nodomain returns |time=0.010892s;;;0.000000
Signed-off-by: Sven Nierlein <sven at nierlein.de>
---
plugins/check_dns.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index 5feafc8..f206163 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -360,6 +360,7 @@ error_scan (char *input_buffer)
/* Host or domain name does not exist */
else if (strstr (input_buffer, "Non-existent") ||
strstr (input_buffer, "** server can't find") ||
+ strstr (input_buffer, "** Can't find") ||
strstr (input_buffer,"NXDOMAIN"))
die (STATE_CRITICAL, _("Domain %s was not found by the server\n"), query_address);
More information about the Commits
mailing list