X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fcheck_load.c;h=7e1cc481e9d777b3662cf404c9f65c6322f9d6eb;hb=6ecaa524bf28b5fb861b161ea075a11119cb3bd2;hp=b918fa54a79ef234f966a4ac0e297756801a5d17;hpb=234481163fc3caf0cb8b14f601f0f9f1458f97f5;p=nagiosplug.git diff --git a/plugins/check_load.c b/plugins/check_load.c index b918fa5..7e1cc48 100644 --- a/plugins/check_load.c +++ b/plugins/check_load.c @@ -20,7 +20,7 @@ const char *progname = "check_load"; const char *revision = "$Revision$"; -const char *copyright = "1999-2003"; +const char *copyright = "1999-2004"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; #include "common.h" @@ -54,7 +54,8 @@ char *status_line; int main (int argc, char **argv) { - int result; + int result = STATE_UNKNOWN; + #if HAVE_GETLOADAVG==1 double la[3] = { 0.0, 0.0, 0.0 }; /* NetBSD complains about unitialized arrays */ #else @@ -73,7 +74,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")); #if HAVE_GETLOADAVG==1 @@ -223,9 +224,7 @@ process_arguments (int argc, char **argv) print_help (); exit (STATE_OK); case '?': /* help */ - printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); - print_usage (); - exit (STATE_UNKNOWN); + usage2 (_("Unknown argument"), optarg); } } @@ -318,7 +317,5 @@ the load average format is the same used by \"uptime\" and \"w\"\n\n")); void print_usage (void) { - printf (_("Usage: %s -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15\n"), - progname); - printf (_(UT_HLP_VRS), progname, progname); + printf ("Usage: %s -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15\n", progname); }