summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e446a43)
raw | patch | inline | side by side (parent: e446a43)
author | Matthew Kent <mattkent@users.sourceforge.net> | |
Fri, 10 Dec 2004 05:57:33 +0000 (05:57 +0000) | ||
committer | Matthew Kent <mattkent@users.sourceforge.net> | |
Fri, 10 Dec 2004 05:57:33 +0000 (05:57 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1022 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_dns.c | patch | blob | history |
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index c30adac7898a8981774a513674221531cf603847..b0ab23cab6df4111ac8a633b3b48726b1e432062 100644 (file)
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
/* scan stderr */
while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_stderr)) {
+
+ if (verbose)
+ printf ("%s", input_buffer);
+
if (error_scan (input_buffer) != STATE_OK) {
result = max_state (result, error_scan (input_buffer));
output = strdup (1 + index (input_buffer, ':'));
/* close stdout */
if (spclose (child_process)) {
result = max_state (result, STATE_WARNING);
- if (!strcmp (output, ""))
+ if (output == NULL || !strcmp (output, ""))
output = strdup (_("nslookup returned error status"));
}
strstr (input_buffer, ": REFUSED")))
die (STATE_CRITICAL, _("Connection to DNS %s was refused\n"), dns_server);
+ /* Query refused (usually by an ACL in the namserver) */
+ else if (strstr (input_buffer, "Query refused"))
+ die (STATE_CRITICAL, _("Query was refused by DNS server at %s\n"), dns_server);
+
+ /* No information (e.g. nameserver IP has two PTR records) */
+ else if (strstr (input_buffer, "No information"))
+ die (STATE_CRITICAL, _("No information returned by DNS server at %s\n"), dns_server);
+
/* Host or domain name does not exist */
else if (strstr (input_buffer, "Non-existent") ||
strstr (input_buffer, "** server can't find") ||