Code

Fix includes for gettext
[nagiosplug.git] / plugins / check_overcr.c
index 581db50fa38cedd59020edf6f8a5ff236954ef0d..9bf40d3cac151b90bd075516e183dbc29168cc43 100644 (file)
  along with this program; if not, write to the Free Software
  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
+ $Id$
 ******************************************************************************/
 
 const char *progname = "check_overcr";
 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"
@@ -61,7 +63,7 @@ void print_help (void);
 int
 main (int argc, char **argv)
 {
-       int result;
+       int result = STATE_UNKNOWN;
        char recv_buffer[MAX_INPUT_BUFFER];
        char temp_buffer[MAX_INPUT_BUFFER];
        char *temp_ptr = NULL;
@@ -84,7 +86,7 @@ main (int argc, char **argv)
        textdomain (PACKAGE);
 
        if (process_arguments (argc, argv) == ERROR)
-               usage ("Could not parse arguments\n");
+               usage4 (_("Could not parse arguments"));
 
        /* initialize alarm signal handling */
        signal (SIGALRM, socket_timeout_alarm_handler);
@@ -178,7 +180,7 @@ main (int argc, char **argv)
                /* error if we couldn't find the info for the disk */
                if (found_disk == FALSE)
                        die (STATE_CRITICAL,
-                                  "Error: Disk '%s' non-existent or not mounted",
+                                  "CRITICAL - Disk '%s' non-existent or not mounted",
                                   disk_name);
 
                if (check_critical_value == TRUE && (percent_used_disk_space >= critical_value))
@@ -281,8 +283,6 @@ main (int argc, char **argv)
 
 
 
-
-
 /* process command-line arguments */
 int
 process_arguments (int argc, char **argv)
@@ -339,7 +339,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 'H':                                                                       /* hostname */
                        server_address = optarg;
@@ -401,16 +401,8 @@ process_arguments (int argc, char **argv)
        }
        return OK;
 }
-\f
-void
-print_usage (void)
-{
-       printf (_("\
-Usage: %s -H host [-p port] [-v variable] [-w warning] [-c critical]\n\
-  [-t timeout]\n"),
-               progname);
-       printf (_(UT_HLP_VRS), progname, progname);
-}
+
+
 
 void
 print_help (void)
@@ -420,8 +412,8 @@ print_help (void)
 
        print_revision (progname, revision);
 
-       printf (_("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n"));
-       printf (_(COPYRIGHT), copyright, email);
+       printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
+       printf (COPYRIGHT, copyright, email);
 
        printf (_("\
 This plugin attempts to contact the Over-CR collector daemon running on the\n\
@@ -465,3 +457,13 @@ Notes:\n\
 
        printf (_(UT_SUPPORT));
 }
+
+
+
+void
+print_usage (void)
+{
+       printf ("\
+Usage: %s -H host [-p port] [-v variable] [-w warning] [-c critical]\n\
+                    [-t timeout]\n", progname);
+}