Code

starttls support for check_smtp #1041576
[nagiosplug.git] / plugins / check_load.c
index b918fa54a79ef234f966a4ac0e297756801a5d17..7e1cc481e9d777b3662cf404c9f65c6322f9d6eb 100644 (file)
@@ -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);
 }