[Nagiosplug-checkins] nagiosplug/plugins check_tcp.c,1.78,1.79

M. Sean Finney seanius at users.sourceforge.net
Sat Sep 2 22:32:29 CEST 2006


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv14341

Modified Files:
	check_tcp.c 
Log Message:
- fix for warning/critical timeouts in check_tcp.c, in which the plugin
  would exit with a usage error if non-int timeouts were passed.
- change --warning-time/--critical-time to just --warning/--critical,
  as it's what --help says.


Index: check_tcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- check_tcp.c	29 Mar 2006 16:33:36 -0000	1.78
+++ check_tcp.c	2 Sep 2006 20:32:27 -0000	1.79
@@ -373,8 +373,8 @@
 	int option = 0;
 	static struct option longopts[] = {
 		{"hostname", required_argument, 0, 'H'},
-		{"critical-time", required_argument, 0, 'c'},
-		{"warning-time", required_argument, 0, 'w'},
+		{"critical", required_argument, 0, 'c'},
+		{"warning", required_argument, 0, 'w'},
 		{"critical-codes", required_argument, 0, 'C'},
 		{"warning-codes", required_argument, 0, 'W'},
 		{"timeout", required_argument, 0, 't'},
@@ -454,20 +454,14 @@
 			server_address = optarg;
 			break;
 		case 'c':                 /* critical */
-			if (!is_intnonneg (optarg))
-				usage4 (_("Critical threshold must be a positive integer"));
-			else
-				critical_time = strtod (optarg, NULL);
+			critical_time = strtod (optarg, NULL);
 			flags |= FLAG_TIME_CRIT;
 			break;
 		case 'j':		  /* hide output */
 			flags |= FLAG_HIDE_OUTPUT;
 			break;
 		case 'w':                 /* warning */
-			if (!is_intnonneg (optarg))
-				usage4 (_("Warning threshold must be a positive integer"));
-			else
-				warning_time = strtod (optarg, NULL);
+			warning_time = strtod (optarg, NULL);
 			flags |= FLAG_TIME_WARN;
 			break;
 		case 'C':





More information about the Commits mailing list