aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_tcp.c
diff options
context:
space:
mode:
authorGravatar M. Sean Finney <seanius@users.sourceforge.net> 2006-09-02 20:32:27 +0000
committerGravatar M. Sean Finney <seanius@users.sourceforge.net> 2006-09-02 20:32:27 +0000
commit1efb32375031098a7a5bb94301796567c06829fc (patch)
tree92ae46e35b4d57706c640af8804a056a74477190 /plugins/check_tcp.c
parent17127bb541a88aa77d278a88a97672961c92c0f5 (diff)
downloadmonitoring-plugins-1efb32375031098a7a5bb94301796567c06829fc.tar.gz
- 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. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1473 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_tcp.c')
-rw-r--r--plugins/check_tcp.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index 5fe024be..bbb8d111 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -373,8 +373,8 @@ process_arguments (int argc, char **argv)
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 @@ process_arguments (int argc, char **argv)
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':