diff options
author | Sven Nierlein <sven@nierlein.de> | 2020-05-20 23:30:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-20 23:30:14 +0200 |
commit | cadac85e12d48d662ff39bfc9f5feb5601af1485 (patch) | |
tree | 7f700a28e2f8c122e9052bc06ffaa9d4e90bd925 /plugins | |
parent | 00948e95f43953359d3a9de6a9dc664723ad7374 (diff) | |
parent | 905b09c38b6b8b08f0fe4a43b9b118366817bf0f (diff) | |
download | monitoring-plugins-cadac85e12d48d662ff39bfc9f5feb5601af1485.tar.gz |
Merge pull request #1634 from ghciv6/check_dns_detect_unreach_svc
detect unreachable dns service in nslookup output
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_dns.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c index d4d0b885..b90f50e6 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c | |||
@@ -202,7 +202,10 @@ main (int argc, char **argv) | |||
202 | if (error_scan (chld_err.line[i]) != STATE_OK) { | 202 | if (error_scan (chld_err.line[i]) != STATE_OK) { |
203 | result = max_state (result, error_scan (chld_err.line[i])); | 203 | result = max_state (result, error_scan (chld_err.line[i])); |
204 | msg = strchr(input_buffer, ':'); | 204 | msg = strchr(input_buffer, ':'); |
205 | if(msg) msg++; | 205 | if(msg) |
206 | msg++; | ||
207 | else | ||
208 | msg = input_buffer; | ||
206 | } | 209 | } |
207 | } | 210 | } |
208 | 211 | ||
@@ -348,6 +351,8 @@ error_scan (char *input_buffer) | |||
348 | /* DNS server is not running... */ | 351 | /* DNS server is not running... */ |
349 | else if (strstr (input_buffer, "No response from server")) | 352 | else if (strstr (input_buffer, "No response from server")) |
350 | die (STATE_CRITICAL, _("No response from DNS %s\n"), dns_server); | 353 | die (STATE_CRITICAL, _("No response from DNS %s\n"), dns_server); |
354 | else if (strstr (input_buffer, "no servers could be reached")) | ||
355 | die (STATE_CRITICAL, _("No response from DNS %s\n"), dns_server); | ||
351 | 356 | ||
352 | /* Host name is valid, but server doesn't have records... */ | 357 | /* Host name is valid, but server doesn't have records... */ |
353 | else if (strstr (input_buffer, "No records")) | 358 | else if (strstr (input_buffer, "No records")) |