Code

return of process_arguments() is TRUE not OK !
[nagiosplug.git] / plugins / check_game.c
index 511e96179dcee83f379d74e2085bf0d40ffb78ee..c8492d8f172aa846eedbbb17cdc7bad73492fe67 100644 (file)
@@ -14,6 +14,7 @@
 * 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_game";
@@ -64,9 +65,12 @@ main (int argc, char **argv)
        bindtextdomain (PACKAGE, LOCALEDIR);
        textdomain (PACKAGE);
 
-       result = process_arguments (argc, argv);
+//     result = process_arguments (argc, argv);
+       
+       if (process_arguments (argc, argv) != TRUE)
+               usage (_("check_game: could not parse arguments\n"));
 
-       if (result != OK) {
+/*     if (result != OK) {
                printf (_("Incorrect arguments supplied\n"));
                printf ("\n");
                print_revision (progname, revision);
@@ -75,6 +79,7 @@ main (int argc, char **argv)
                printf ("\n");
                return STATE_UNKNOWN;
        }
+*/
 
        result = STATE_OK;
 
@@ -111,7 +116,7 @@ main (int argc, char **argv)
         */
 
        if (!strncmp (input_buffer, "unknown option", 14)) {
-               printf (_("ERROR: Host type parameter incorrect!\n"));
+               printf (_("CRITICAL - Host type parameter incorrect!\n"));
                result = STATE_CRITICAL;
                return result;
        }
@@ -131,15 +136,15 @@ main (int argc, char **argv)
        }
 
        if (strstr (ret[2], QSTAT_HOST_ERROR)) {
-               printf ("ERROR: Host not found\n");
+               printf ("CRITICAL - Host not found\n");
                result = STATE_CRITICAL;
        }
        else if (strstr (ret[2], QSTAT_HOST_DOWN)) {
-               printf ("ERROR: Game server down or unavailable\n");
+               printf ("CRITICAL - Game server down or unavailable\n");
                result = STATE_CRITICAL;
        }
        else if (strstr (ret[2], QSTAT_HOST_TIMEOUT)) {
-               printf ("ERROR: Game server timeout\n");
+               printf ("CRITICAL - Game server timeout\n");
                result = STATE_CRITICAL;
        }
        else {
@@ -302,7 +307,6 @@ validate_arguments (void)
 
 
 
-\f
 void
 print_help (void)
 {