SF.net SVN: nagiosplug:[2181] nagiosplug/trunk/plugins/check_http.c

[email protected]
Newsgroups gmane.network.nagios.plugins.cvs
Message-ID <[email protected]>
Revision: 2181
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=2181&view=rev
Author:   dermoth
Date:     2009-03-21 06:41:26 +0000 (Sat, 21 Mar 2009)

Log Message:
-----------
check_http: die when an invalid --onredirect option is specified

From: Thomas Guyot-Sionnest <[email protected]>

Modified Paths:
--------------
    nagiosplug/trunk/plugins/check_http.c

Modified: nagiosplug/trunk/plugins/check_http.c
===================================================================
--- nagiosplug/trunk/plugins/check_http.c	2009-03-21 06:41:16 UTC (rev 2180)
+++ nagiosplug/trunk/plugins/check_http.c	2009-03-21 06:41:26 UTC (rev 2181)
@@ -305,18 +305,19 @@
     case 'f': /* onredirect */
       if (!strcmp (optarg, "stickyport"))
         onredirect = STATE_DEPENDENT, followsticky = STICKY_HOST|STICKY_PORT;
-      if (!strcmp (optarg, "sticky"))
+      else if (!strcmp (optarg, "sticky"))
         onredirect = STATE_DEPENDENT, followsticky = STICKY_HOST;
-      if (!strcmp (optarg, "follow"))
+      else if (!strcmp (optarg, "follow"))
         onredirect = STATE_DEPENDENT, followsticky = STICKY_NONE;
-      if (!strcmp (optarg, "unknown"))
+      else if (!strcmp (optarg, "unknown"))
         onredirect = STATE_UNKNOWN;
-      if (!strcmp (optarg, "ok"))
+      else if (!strcmp (optarg, "ok"))
         onredirect = STATE_OK;
-      if (!strcmp (optarg, "warning"))
+      else if (!strcmp (optarg, "warning"))
         onredirect = STATE_WARNING;
-      if (!strcmp (optarg, "critical"))
+      else if (!strcmp (optarg, "critical"))
         onredirect = STATE_CRITICAL;
+      else usage2 (_("Invalid onredirect option"), optarg);
       if (verbose)
         printf(_("option f:%d \n"), onredirect);
       break;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.