Code

Add another error string match from Pasi Tiittanen
[nagiosplug.git] / plugins / check_ups.c
index 4006031f183f3ddd98f94da01935f5527a50bef6..a4d765038882a9493767af05a96113ec8ff7b0fb 100644 (file)
 
 const char *progname = "check_ups";
 const char *revision = "$Revision$";
-const char *copyright = "2000-2002";
+const char *copyright = "2000-2004";
 const char *email = "nagiosplug-devel@lists.sourceforge.net";
 
-#include <locale.h>
 #include "common.h"
 #include "netutils.h"
 #include "utils.h"
@@ -96,7 +95,7 @@ void print_usage (void);
 int
 main (int argc, char **argv)
 {
-       int result = STATE_OK;
+       int result = STATE_UNKNOWN;
        char *message;
        char *data;
        char temp_buffer[MAX_INPUT_BUFFER];
@@ -111,8 +110,8 @@ main (int argc, char **argv)
        data = strdup ("");
        message = strdup ("");
 
-       if (process_arguments (argc, argv) != TRUE)
-               usage (_("check_ups: 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);
@@ -593,7 +592,6 @@ print_help (void)
        printf ("Copyright (c) 2000 Tom Shields");
        printf ("Copyright (c) 2004 Alain Richard <alain.richard@equation.fr>\n");
        printf ("Copyright (c) 2004 Arnaud Quette <arnaud.quette@mgeups.com>\n");
-
        printf (COPYRIGHT, copyright, email);
 
        printf (_("This plugin tests the UPS service on the specified host.\n\
@@ -647,8 +645,7 @@ http://www.networkupstools.org\n\n"));
 void
 print_usage (void)
 {
-       printf (_("\
+       printf ("\
 Usage: %s -H host -u ups [-p port] [-v variable]\n\
-  [-wv warn_value] [-cv crit_value] [-to to_sec] [-T]\n"), progname);
-       printf (_(UT_HLP_VRS), progname, progname);
+                  [-wv warn_value] [-cv crit_value] [-to to_sec] [-T]\n", progname);
 }