diff --git a/plugins/check_dig.c b/plugins/check_dig.c
index 211c16c0cd3986bd09fa003c2ea8498a0f8b31dc..4394490e8723ea0fe31c2a0a5d71ca1b0eb022b4 100644 (file)
--- a/plugins/check_dig.c
+++ b/plugins/check_dig.c
const char *progname = "check_dig";
const char *revision = "$Revision$";
const char *progname = "check_dig";
const char *revision = "$Revision$";
-const char *copyright = "2002-2003";
+const char *copyright = "2002-2004";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
#include "common.h"
const char *email = "nagiosplug-devel@lists.sourceforge.net";
#include "common.h"
char input_buffer[MAX_INPUT_BUFFER];
char *command_line;
char *output;
char input_buffer[MAX_INPUT_BUFFER];
char *command_line;
char *output;
+ char *t;
long microsec;
double elapsed_time;
int result = STATE_UNKNOWN;
long microsec;
double elapsed_time;
int result = STATE_UNKNOWN;
if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR)
usage4 (_("Cannot catch SIGALRM"));
if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR)
usage4 (_("Cannot catch SIGALRM"));
- if (process_arguments (argc, argv) != TRUE)
+ if (process_arguments (argc, argv) == ERROR)
usage4 (_("Could not parse arguments"));
/* get the command to run */
usage4 (_("Could not parse arguments"));
/* get the command to run */
if (verbose) {
printf ("%s\n", command_line);
if(expected_address != NULL) {
if (verbose) {
printf ("%s\n", command_line);
if(expected_address != NULL) {
- printf ("Looking for: '%s'\n", expected_address);
+ printf (_("Looking for: '%s'\n"), expected_address);
} else {
} else {
- printf ("Looking for: '%s'\n", query_address);
+ printf (_("Looking for: '%s'\n"), query_address);
}
}
}
}
result = STATE_OK;
}
result = STATE_OK;
}
+ /* Translate output TAB -> SPACE */
+ t = output;
+ while ((t = index(t, '\t')) != NULL)
+ *t = ' ';
+
} while (!strstr (input_buffer, ";; "));
if (result == STATE_UNKNOWN) {
} while (!strstr (input_buffer, ";; "));
if (result == STATE_UNKNOWN) {
switch (c) {
case '?': /* help */
switch (c) {
case '?': /* help */
- 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);
case 'V': /* version */
case 'h': /* help */
print_help ();
exit (STATE_OK);
case 'V': /* version */
- print_revision (progname, "$Revision$");
+ print_revision (progname, revision);
exit (STATE_OK);
case 'H': /* hostname */
if (is_host (optarg)) {
exit (STATE_OK);
case 'H': /* hostname */
if (is_host (optarg)) {
printf (_("\
-a, --expected_address=STRING\n\
printf (_("\
-a, --expected_address=STRING\n\
- an address expected to be in the asnwer section.\n\
+ an address expected to be in the answer section.\n\
if not set, uses whatever was in -l\n"));
printf (_(UT_WARN_CRIT));
if not set, uses whatever was in -l\n"));
printf (_(UT_WARN_CRIT));
void
print_usage (void)
{
void
print_usage (void)
{
- printf (_("\
+ printf ("\
Usage: %s -H host -l lookup [-p <server port>] [-T <query type>]\n\
Usage: %s -H host -l lookup [-p <server port>] [-T <query type>]\n\
- [-w <warning interval>] [-c <critical interval>] [-t <timeout>]\n\
- [-a <expected answer address>] [-v]\n"),
- progname);
- printf (" %s (-h|--help)\n", progname);
- printf (" %s (-V|--version)\n", progname);
+ [-w <warning interval>] [-c <critical interval>] [-t <timeout>]\n\
+ [-a <expected answer address>] [-v]\n", progname);
}
}