summaryrefslogtreecommitdiffstats
path: root/plugins/check_dns.c
diff options
context:
space:
mode:
authorSven Nierlein <sven@nierlein.de>2017-03-12 20:02:58 (GMT)
committerSven Nierlein <sven@nierlein.de>2017-03-12 20:02:58 (GMT)
commit9daeceaed39b04e79ba364e311e0532e4fdf711f (patch)
tree88bda4b932702a02c84b80fb3f311da9ec06ecdc /plugins/check_dns.c
parent0d73b499dd939924d49f955ac84550fab5f3cdde (diff)
downloadmonitoring-plugins-9daeceaed39b04e79ba364e311e0532e4fdf711f.tar.gz
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@nierlein.de>
Diffstat (limited to 'plugins/check_dns.c')
-rw-r--r--plugins/check_dns.c1
1 files changed, 1 insertions, 0 deletions
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)
360 /* Host or domain name does not exist */ 360 /* Host or domain name does not exist */
361 else if (strstr (input_buffer, "Non-existent") || 361 else if (strstr (input_buffer, "Non-existent") ||
362 strstr (input_buffer, "** server can't find") || 362 strstr (input_buffer, "** server can't find") ||
363 strstr (input_buffer, "** Can't find") ||
363 strstr (input_buffer,"NXDOMAIN")) 364 strstr (input_buffer,"NXDOMAIN"))
364 die (STATE_CRITICAL, _("Domain %s was not found by the server\n"), query_address); 365 die (STATE_CRITICAL, _("Domain %s was not found by the server\n"), query_address);
365 366