aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jan Wagner <waja@cyconet.org> 2014-07-30 23:33:57 +0200
committerGravatar Jan Wagner <waja@cyconet.org> 2014-07-30 23:33:57 +0200
commit8775edcb10c699f3e23a6c9eed071900e254d11e (patch)
treeaaa68e6b2cea47d471843fc55c32b6e0883ea34f
parentfe066559f29aa676d28cde30e28a3da66907ae0a (diff)
parent3b640c32b95053acb998a2a2493359f6d0522d74 (diff)
downloadmonitoring-plugins-8775edcb10c699f3e23a6c9eed071900e254d11e.tar.gz
Merge pull request #1164 from waja/github981
-rw-r--r--THANKS.in1
-rw-r--r--plugins/check_dns.c22
2 files changed, 23 insertions, 0 deletions
diff --git a/THANKS.in b/THANKS.in
index 0d004aa6..433698ca 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -328,3 +328,4 @@ Julius Kriukas
Patrick McAndrew
Alexander Wittig
Jason Benguerel
+Matthew Kent
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index 31a953d7..d7f7346f 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -136,6 +136,28 @@ main (int argc, char **argv)
}
}
+ /* bug ID: 2946553 - Older versions of bind will use all available dns
+ servers, we have to match the one specified */
+ if (strstr (chld_out.line[i], "Server:") && strlen(dns_server) > 0) {
+ temp_buffer = strchr (chld_out.line[i], ':');
+ temp_buffer++;
+
+ /* Strip leading tabs */
+ for (; *temp_buffer != '\0' && *temp_buffer == '\t'; temp_buffer++)
+ /* NOOP */;
+
+ strip(temp_buffer);
+ if (temp_buffer==NULL || strlen(temp_buffer)==0) {
+ die (STATE_CRITICAL,
+ _("DNS CRITICAL - '%s' returned empty server string\n"),
+ NSLOOKUP_COMMAND);
+ }
+
+ if (strcmp(temp_buffer, dns_server) != 0) {
+ die (STATE_CRITICAL, _("No response from DNS %s\n"), dns_server);
+ }
+ }
+
/* the server is responding, we just got the host name... */
if (strstr (chld_out.line[i], "Name:"))
parse_address = TRUE;