Code

Fix includes for gettext
[nagiosplug.git] / plugins / check_nagios.c
index 4439251fba5b298c292a45ca8a1c27f55e917746..b567fe10c8e83f91ae26c50ed9ae717754e55dc3 100644 (file)
@@ -20,7 +20,7 @@
 
 const char *progname = "check_nagios";
 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,6 +54,7 @@ main (int argc, char **argv)
        int procrss = 0;
        float procpcpu = 0;
        char procstat[8];
+       char procetime[MAX_INPUT_BUFFER];
        char procprog[MAX_INPUT_BUFFER];
        char *procargs;
        int pos, cols;
@@ -66,12 +67,11 @@ main (int argc, char **argv)
        textdomain (PACKAGE);
 
        if (process_arguments (argc, argv) == ERROR)
-               usage (_("check_nagios: could not parse arguments\n"));
+               usage4 (_("Could not parse arguments"));
 
-       /* Set signal handling and alarm */
+       /* Set signal handling and alarm timeout */
        if (signal (SIGALRM, timeout_alarm_handler) == SIG_ERR) {
-               printf (_("Cannot catch SIGALRM"));
-               return STATE_UNKNOWN;
+               usage4 (_("Cannot catch SIGALRM"));
        }
 
        /* handle timeouts gracefully... */
@@ -80,7 +80,7 @@ main (int argc, char **argv)
        /* open the status log */
        fp = fopen (status_log, "r");
        if (fp == NULL) {
-               printf (_("ERROR - Cannot open status log for reading!\n"));
+               printf (_("CRITICAL - Cannot open status log for reading!\n"));
                return STATE_CRITICAL;
        }
 
@@ -227,7 +227,7 @@ process_arguments (int argc, char **argv)
                        print_help ();
                        exit (STATE_OK);
                case 'V':                                                                       /* version */
-                       print_revision (progname, "$Revision$");
+                       print_revision (progname, revision);
                        exit (STATE_OK);
                case 'F':                                                                       /* status log */
                        status_log = optarg;
@@ -276,7 +276,7 @@ This plugin attempts to check the status of the Nagios process on the local\n\
 machine. The plugin will check to make sure the Nagios status log is no older\n\
 than the number of minutes specified by the <expire_minutes> option.  It also\n\
 uses the /bin/ps command to check for a process matching whatever you specify\n\
-by the <process_string> argument.\n"));
+by the <process_string> argument.\n\n"));
 
        print_usage ();
 
@@ -302,7 +302,6 @@ Example:\n\
 void
 print_usage (void)
 {
-       printf (_("\
-Usage: %s -F <status log file> -e <expire_minutes> -C <process_string>\n"),
-               progname);
+       printf ("\
+Usage: %s -F <status log file> -e <expire_minutes> -C <process_string>\n", progname);
 }