diff options
author | Jan Wagner <waja@cyconet.org> | 2014-07-30 21:33:57 (GMT) |
---|---|---|
committer | Jan Wagner <waja@cyconet.org> | 2014-07-30 21:33:57 (GMT) |
commit | 8775edcb10c699f3e23a6c9eed071900e254d11e (patch) | |
tree | aaa68e6b2cea47d471843fc55c32b6e0883ea34f /plugins/check_dns.c | |
parent | fe066559f29aa676d28cde30e28a3da66907ae0a (diff) | |
parent | 3b640c32b95053acb998a2a2493359f6d0522d74 (diff) | |
download | monitoring-plugins-8775edcb10c699f3e23a6c9eed071900e254d11e.tar.gz |
Merge pull request #1164 from waja/github981
Diffstat (limited to 'plugins/check_dns.c')
-rw-r--r-- | plugins/check_dns.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c index 31a953d..d7f7346 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c | |||
@@ -136,6 +136,28 @@ main (int argc, char **argv) | |||
136 | } | 136 | } |
137 | } | 137 | } |
138 | 138 | ||
139 | /* bug ID: 2946553 - Older versions of bind will use all available dns | ||
140 | servers, we have to match the one specified */ | ||
141 | if (strstr (chld_out.line[i], "Server:") && strlen(dns_server) > 0) { | ||
142 | temp_buffer = strchr (chld_out.line[i], ':'); | ||
143 | temp_buffer++; | ||
144 | |||
145 | /* Strip leading tabs */ | ||
146 | for (; *temp_buffer != '\0' && *temp_buffer == '\t'; temp_buffer++) | ||
147 | /* NOOP */; | ||
148 | |||
149 | strip(temp_buffer); | ||
150 | if (temp_buffer==NULL || strlen(temp_buffer)==0) { | ||
151 | die (STATE_CRITICAL, | ||
152 | _("DNS CRITICAL - '%s' returned empty server string\n"), | ||
153 | NSLOOKUP_COMMAND); | ||
154 | } | ||
155 | |||
156 | if (strcmp(temp_buffer, dns_server) != 0) { | ||
157 | die (STATE_CRITICAL, _("No response from DNS %s\n"), dns_server); | ||
158 | } | ||
159 | } | ||
160 | |||
139 | /* the server is responding, we just got the host name... */ | 161 | /* the server is responding, we just got the host name... */ |
140 | if (strstr (chld_out.line[i], "Name:")) | 162 | if (strstr (chld_out.line[i], "Name:")) |
141 | parse_address = TRUE; | 163 | parse_address = TRUE; |