Code

Fix includes for gettext
[nagiosplug.git] / plugins / check_snmp.c
index 5167eb584d35a94f37af92e135cc53fcb5aacc72..c1c4ea831b7db57093296956fe12ebb9fbde1e94 100644 (file)
@@ -20,7 +20,7 @@
 
 const char *progname = "check_snmp";
 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"
@@ -156,8 +156,8 @@ main (int argc, char **argv)
        output_delim = strdup (DEFAULT_OUTPUT_DELIMITER);
        miblist = strdup (DEFAULT_MIBLIST);
 
-       if (process_arguments (argc, argv) != OK)
-               usage (_("check_snmp: could not parse arguments\n"));
+       if (process_arguments (argc, argv) == ERROR)
+               usage4 (_("Could not parse arguments"));
 
        /* create the command line to execute */
        asprintf (&command_line, "%s -t 1 -r %d -m %s -v %s %s %s:%s %s",
@@ -259,7 +259,7 @@ main (int argc, char **argv)
 
                /* Process this block for string matching */
                else if (eval_method[i] & CRIT_STRING) {
-                       if (strcmp (response, string_value))
+                       if (strcmp (show, string_value))
                                iresult = STATE_CRITICAL;
                        else
                                iresult = STATE_OK;
@@ -656,7 +656,7 @@ validate_arguments ()
                }
                else if ( strcmp(seclevel, "authPriv") == 0 ) {
                        if ( secname == NULL || authpasswd == NULL || privpasswd == NULL ) {
-                               printf (("Missing secname (%s), authpassword (%s), or privpasswd (%s)! \n"),secname, authpasswd,privpasswd );
+                               printf (_("Missing secname (%s), authpassword (%s), or privpasswd (%s)! \n"),secname, authpasswd,privpasswd );
                                print_usage ();
                                exit (STATE_UNKNOWN);
                        }
@@ -842,7 +842,7 @@ print_help (void)
 {
        print_revision (progname, revision);
 
-       printf (_(COPYRIGHT), copyright, email);
+       printf (COPYRIGHT, copyright, email);
 
        printf (_("\
 Check status of remote machines and obtain sustem information via SNMP\n\n"));
@@ -948,12 +948,11 @@ Check status of remote machines and obtain sustem information via SNMP\n\n"));
 void
 print_usage (void)
 {
-       printf (_("\
+       printf ("\
 Usage: %s -H <ip_address> -o <OID> [-w warn_range] [-c crit_range] \n\
-  [-C community] [-s string] [-r regex] [-R regexi] [-t timeout]\n\
-  [-l label] [-u units] [-p port-number] [-d delimiter]\n\
-  [-D output-delimiter] [-m miblist] [-P snmp version]\n\
-  [-L seclevel] [-U secname] [-a authproto] [-A authpasswd]\n\
-  [-X privpasswd]\n"), progname);
-       printf (_(UT_HLP_VRS), progname, progname);
+                  [-C community] [-s string] [-r regex] [-R regexi] [-t timeout]\n\
+                  [-l label] [-u units] [-p port-number] [-d delimiter]\n\
+                  [-D output-delimiter] [-m miblist] [-P snmp version]\n\
+                  [-L seclevel] [-U secname] [-a authproto] [-A authpasswd]\n\
+                  [-X privpasswd]\n", progname);
 }