diff --git a/plugins/check_real.c b/plugins/check_real.c
index 59ad7d0396bd994337bda387eaf348b641e7d53e..eb892c77fc594d8efbb911cbdffca387c0a934b1 100644 (file)
--- a/plugins/check_real.c
+++ b/plugins/check_real.c
const char *progname = "check_real";
const char *revision = "$Revision$";
-const char *copyright = "2000-2003";
+const char *copyright = "2000-2004";
const char *email = "nagiosplug-devel@lists.sourceforge.net";
#include "common.h"
main (int argc, char **argv)
{
int sd;
- int result;
+ int result = STATE_UNKNOWN;
char buffer[MAX_INPUT_BUFFER];
char *status_line = NULL;
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
- if (process_arguments (argc, argv) != OK)
- usage (_("check_real: could not parse arguments\n"));
+ if (process_arguments (argc, argv) == ERROR)
+ usage4 (_("Could not parse arguments"));
/* initialize alarm signal handling */
signal (SIGALRM, socket_timeout_alarm_handler);
server_port = atoi (optarg);
}
else {
- usage (_("Port must be a positive integer\n"));
+ usage4 (_("Port must be a positive integer"));
}
break;
case 'w': /* warning time threshold */
check_warning_time = TRUE;
}
else {
- usage (_("Warning time must be a positive integer\n"));
+ usage4 (_("Warning time must be a positive integer"));
}
break;
case 'c': /* critical time threshold */
check_critical_time = TRUE;
}
else {
- usage (_("Critical time must be a nonnegative integer\n"));
+ usage4 (_("Critical time must be a positive integer"));
}
break;
case 'v': /* verbose */
socket_timeout = atoi (optarg);
}
else {
- usage (_("Time interval must be a nonnegative integer\n"));
+ usage4 (_("Timeout interval must be a positive integer"));
}
break;
case 'V': /* version */
print_help ();
exit (STATE_OK);
case '?': /* usage */
- printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
- print_usage ();
- exit (STATE_UNKNOWN);
+ usage2 (_("Unknown argument"), optarg);
}
}
}
if (server_address==NULL)
- usage (_("You must provide a server to check\n"));
+ usage4 (_("You must provide a server to check"));
if (host_name==NULL)
host_name = strdup (server_address);
{
printf ("\
Usage: %s -H host [-e expect] [-p port] [-w warn] [-c crit]\n\
- [-t timeout] [-v]\n", progname);
- printf (_(UT_HLP_VRS), progname, progname);
+ [-t timeout] [-v]\n", progname);
}