X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fcheck_fping.c;h=5ffcd16e35ed3a02bcc9fafd61b7b0774720ba33;hb=20d0154211fa46028383ed3a88b558731313c389;hp=ce62a7c86104c845c471902bad51ce551d3828f3;hpb=5e3fc41c6143676cf01b7aad789fc5f2cae5ce84;p=nagiosplug.git diff --git a/plugins/check_fping.c b/plugins/check_fping.c index ce62a7c..5ffcd16 100644 --- a/plugins/check_fping.c +++ b/plugins/check_fping.c @@ -69,7 +69,7 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - if (process_arguments (argc, argv) != TRUE) + if (process_arguments (argc, argv) == ERROR) usage4 (_("Could not parse arguments")); server = strscpy (server, server_name); @@ -242,9 +242,7 @@ process_arguments (int argc, char **argv) switch (c) { case '?': /* print short usage statement if 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); @@ -301,15 +299,13 @@ process_arguments (int argc, char **argv) } } - if (server_name == NULL) - usage (_("Hostname was not supplied\n\n")); + usage4 (_("Hostname was not supplied")); return OK; } - int get_threshold (char *arg, char *rv[2]) { @@ -351,7 +347,6 @@ get_threshold (char *arg, char *rv[2]) } - void print_help (void) { @@ -395,7 +390,6 @@ percentage of packet loss to trigger an alarm state.\n")); } - void print_usage (void) {