diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index 39023f950b45e8db31d9c6b41a5925417d1d7b4e..9ab001f7eea61cdcf8ef5a61e2012f5d374210b2 100644 (file)
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
LIMITATION: nslookup on Solaris 7 can return output over 2 lines, which will not
be picked up by this plugin
+
+ $Id$
******************************************************************************/
}
if (process_arguments (argc, argv) != OK) {
- print_usage ();
+ usage (_("check_dns: could not parse arguments\n"));
return STATE_UNKNOWN;
}
if ((temp_buffer = strstr (input_buffer, "name = ")))
address = strdup (temp_buffer + 7);
else {
- output = strdup (_("Unknown error (plugin)"));
+ output = strdup (_("Warning plugin error"));
result = STATE_WARNING;
}
}
printf (_("DNS CRITICAL - %s\n"),
!strcmp (output, "") ? _(" Probably a non-existent host/domain") : output);
else
- printf (_("DNS problem - %s\n"),
+ printf (_("DNS UNKNOW - %s\n"),
!strcmp (output, "") ? _(" Probably a non-existent host/domain") : output);
return result;
}
+
+
int
error_scan (char *input_buffer)
{
}
+
+
/* process command-line arguments */
int
process_arguments (int argc, char **argv)
/* TODO: this is_host check is probably unnecessary. */
/* Better to confirm nslookup response matches */
if (is_host (optarg) == FALSE) {
- printf (_("Invalid server name/address\n\n"));
+ printf (_("Invalid hostname/address\n\n"));
print_usage ();
exit (STATE_UNKNOWN);
}
case 'r': /* reverse server name */
/* TODO: Is this is_host necessary? */
if (is_host (optarg) == FALSE) {
- printf (_("Invalid host name/address\n\n"));
- print_usage ();
- exit (STATE_UNKNOWN);
+ usage2 (_("Invalid hostname/address"), optarg);
}
if (strlen (optarg) >= ADDRESS_LENGTH)
die (STATE_UNKNOWN, _("Input buffer overflow\n"));
if (strlen(dns_server)==0 && c<argc) {
/* TODO: See -s option */
if (is_host(argv[c]) == FALSE) {
- printf (_("Invalid name/address: %s\n\n"), argv[c]);
+ printf (_("Invalid hostname/address: %s\n\n"), argv[c]);
return ERROR;
}
if (strlen(argv[c]) >= ADDRESS_LENGTH)
return validate_arguments ();
}
+
+
int
validate_arguments ()
{
-
-
-\f
void
print_help (void)
{
print_revision (progname, revision);
- printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
- printf (_(COPYRIGHT), copyright, email);
+ printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
+ printf (COPYRIGHT, copyright, email);
print_usage ();
-
void
print_usage (void)
{