Code

Add another error string match from Pasi Tiittanen
[nagiosplug.git] / plugins / check_real.c
index 4ede6a5c32f9dc839caa63f1a1917bc47b688f37..30424656ef411a3c3af0646865b7298e5de2d172 100644 (file)
@@ -20,7 +20,7 @@
 
 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"
@@ -56,7 +56,7 @@ int
 main (int argc, char **argv)
 {
        int sd;
-       int result;
+       int result = STATE_UNKNOWN;
        char buffer[MAX_INPUT_BUFFER];
        char *status_line = NULL;
 
@@ -64,7 +64,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"));
 
        /* initialize alarm signal handling */
@@ -312,7 +312,7 @@ process_arguments (int argc, char **argv)
                                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 */
@@ -321,7 +321,7 @@ process_arguments (int argc, char **argv)
                                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 */
@@ -330,7 +330,7 @@ process_arguments (int argc, char **argv)
                                check_critical_time = TRUE;
                        }
                        else {
-                               usage (_("Critical time must be a nonnegative integer\n"));
+                               usage4 (_("Critical time must be a nonnegative integer"));
                        }
                        break;
                case 'v':                                                                       /* verbose */
@@ -341,7 +341,7 @@ process_arguments (int argc, char **argv)
                                socket_timeout = atoi (optarg);
                        }
                        else {
-                               usage (_("Time interval must be a nonnegative integer\n"));
+                               usage4 (_("Time interval must be a nonnegative integer"));
                        }
                        break;
                case 'V':                                                                       /* version */
@@ -438,6 +438,5 @@ print_usage (void)
 {
        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);
 }