[Nagiosplug-checkins] SF.net SVN: nagiosplug: [1827] nagiosplug/trunk

dermoth at users.sourceforge.net dermoth at users.sourceforge.net
Sun Nov 11 17:29:06 CET 2007


Revision: 1827
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=1827&view=rev
Author:   dermoth
Date:     2007-11-11 08:29:05 -0800 (Sun, 11 Nov 2007)

Log Message:
-----------
Fix broken usage2 in check_snmp and check_cluster
Fix check_cluster blocking some special characters for thresholds ("-", "@", "~")

Modified Paths:
--------------
    nagiosplug/trunk/NEWS
    nagiosplug/trunk/plugins/check_cluster.c
    nagiosplug/trunk/plugins/check_snmp.c

Modified: nagiosplug/trunk/NEWS
===================================================================
--- nagiosplug/trunk/NEWS	2007-11-10 22:55:46 UTC (rev 1826)
+++ nagiosplug/trunk/NEWS	2007-11-11 16:29:05 UTC (rev 1827)
@@ -9,6 +9,8 @@
 	  and the offset is unavailable, will return UNKNOWN as well.
 	  NOTE: If jitter thresholds are specified integers it will return CRITICAL if jitter
 	  is "-1" as the default range starts at 0. See Examples in --help output.
+	Fix broken usage2 in check_snmp and check_cluster
+	check_cluster now accept all valid characters in its thresholds ("-", "@", "~")
 
 1.4.10 28th September 2007
 	Fix check_http buffer overflow vulnerability when following HTTP redirects

Modified: nagiosplug/trunk/plugins/check_cluster.c
===================================================================
--- nagiosplug/trunk/plugins/check_cluster.c	2007-11-10 22:55:46 UTC (rev 1826)
+++ nagiosplug/trunk/plugins/check_cluster.c	2007-11-11 16:29:05 UTC (rev 1827)
@@ -178,14 +178,10 @@
 			break;
 
 		case 'w': /* warning threshold */
-			if (strspn (optarg, "0123456789:,") < strlen (optarg))
-				usage2 (_("Invalid warning threshold: %s\n"), optarg);
 			warn_threshold = strdup(optarg);
 			break;
 
 		case 'c': /* warning threshold */
-			if (strspn (optarg, "0123456789:,") < strlen (optarg))
-				usage2 (_("Invalid critical threshold: %s\n"), optarg);
 			crit_threshold = strdup(optarg);
 			break;
 

Modified: nagiosplug/trunk/plugins/check_snmp.c
===================================================================
--- nagiosplug/trunk/plugins/check_snmp.c	2007-11-10 22:55:46 UTC (rev 1826)
+++ nagiosplug/trunk/plugins/check_snmp.c	2007-11-11 16:29:05 UTC (rev 1827)
@@ -521,7 +521,7 @@
 	/* Test parameters */
 		case 'c':									/* critical time threshold */
 			if (strspn (optarg, "0123456789:,") < strlen (optarg))
-				usage2 (_("Invalid critical threshold: %s\n"), optarg);
+				usage2 (_("Invalid critical threshold"), optarg);
 			for (ptr = optarg; ptr && jj < MAX_OIDS; jj++) {
 				if (llu_getll (&lower_crit_lim[jj], ptr) == 1)
 					eval_method[jj] |= CRIT_LT;
@@ -532,7 +532,7 @@
 			break;
 		case 'w':									/* warning time threshold */
 			if (strspn (optarg, "0123456789:,") < strlen (optarg))
-				usage2 (_("Invalid warning threshold: %s\n"), optarg);
+				usage2 (_("Invalid warning threshold"), optarg);
 			for (ptr = optarg; ptr && ii < MAX_OIDS; ii++) {
 				if (llu_getll (&lower_warn_lim[ii], ptr) == 1)
 					eval_method[ii] |= WARN_LT;


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




More information about the Commits mailing list