diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index c30adac7898a8981774a513674221531cf603847..94d4300c85e5f54c004120549a62b3f21562813f 100644 (file)
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
asprintf(&address, "%s,%s", address, temp_buffer);
}
- else if (strstr (input_buffer, "Non-authoritative answer:")) {
+ else if (strstr (input_buffer, _("Non-authoritative answer:"))) {
non_authoritative = TRUE;
}
/* 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"));
}
{
/* the DNS lookup timed out */
- if (strstr (input_buffer, "Note: nslookup is deprecated and may be removed from future releases.") ||
- strstr (input_buffer, "Consider using the `dig' or `host' programs instead. Run nslookup with") ||
- strstr (input_buffer, "the `-sil[ent]' option to prevent this message from appearing."))
+ if (strstr (input_buffer, _("Note: nslookup is deprecated and may be removed from future releases.")) ||
+ strstr (input_buffer, _("Consider using the `dig' or `host' programs instead. Run nslookup with")) ||
+ strstr (input_buffer, _("the `-sil[ent]' option to prevent this message from appearing.")))
return STATE_OK;
/* DNS server is not running... */
/* Connection was refused */
else if (strstr (input_buffer, "Connection refused") ||
+ strstr (input_buffer, "Couldn't find server") ||
strstr (input_buffer, "Refused") ||
(strstr (input_buffer, "** server can't find") &&
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") ||
- strstr (input_buffer,"NXDOMAIN"))
+ strstr (input_buffer,"NXDOMAIN"))
die (STATE_CRITICAL, _("Domain %s was not found by the server\n"), query_address);
/* Network is unreachable */
}
-
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
switch (c) {
case '?': /* args not parsable */
- printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
- print_usage ();
- exit (STATE_UNKNOWN);
+ usage2 (_("Unknown argument"), optarg);
case 'h': /* help */
print_help ();
exit (STATE_OK);
}
-
int
validate_arguments ()
{
}
-
void
print_help (void)
{
}
-
void
print_usage (void)
{