diff options
author | M. Sean Finney <seanius@users.sourceforge.net> | 2006-09-02 20:32:27 (GMT) |
---|---|---|
committer | M. Sean Finney <seanius@users.sourceforge.net> | 2006-09-02 20:32:27 (GMT) |
commit | 1efb32375031098a7a5bb94301796567c06829fc (patch) | |
tree | 92ae46e35b4d57706c640af8804a056a74477190 /plugins | |
parent | 17127bb541a88aa77d278a88a97672961c92c0f5 (diff) | |
download | monitoring-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')
-rw-r--r-- | plugins/check_tcp.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index 5fe024b..bbb8d11 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c | |||
@@ -373,8 +373,8 @@ process_arguments (int argc, char **argv) | |||
373 | int option = 0; | 373 | int option = 0; |
374 | static struct option longopts[] = { | 374 | static struct option longopts[] = { |
375 | {"hostname", required_argument, 0, 'H'}, | 375 | {"hostname", required_argument, 0, 'H'}, |
376 | {"critical-time", required_argument, 0, 'c'}, | 376 | {"critical", required_argument, 0, 'c'}, |
377 | {"warning-time", required_argument, 0, 'w'}, | 377 | {"warning", required_argument, 0, 'w'}, |
378 | {"critical-codes", required_argument, 0, 'C'}, | 378 | {"critical-codes", required_argument, 0, 'C'}, |
379 | {"warning-codes", required_argument, 0, 'W'}, | 379 | {"warning-codes", required_argument, 0, 'W'}, |
380 | {"timeout", required_argument, 0, 't'}, | 380 | {"timeout", required_argument, 0, 't'}, |
@@ -454,20 +454,14 @@ process_arguments (int argc, char **argv) | |||
454 | server_address = optarg; | 454 | server_address = optarg; |
455 | break; | 455 | break; |
456 | case 'c': /* critical */ | 456 | case 'c': /* critical */ |
457 | if (!is_intnonneg (optarg)) | 457 | critical_time = strtod (optarg, NULL); |
458 | usage4 (_("Critical threshold must be a positive integer")); | ||
459 | else | ||
460 | critical_time = strtod (optarg, NULL); | ||
461 | flags |= FLAG_TIME_CRIT; | 458 | flags |= FLAG_TIME_CRIT; |
462 | break; | 459 | break; |
463 | case 'j': /* hide output */ | 460 | case 'j': /* hide output */ |
464 | flags |= FLAG_HIDE_OUTPUT; | 461 | flags |= FLAG_HIDE_OUTPUT; |
465 | break; | 462 | break; |
466 | case 'w': /* warning */ | 463 | case 'w': /* warning */ |
467 | if (!is_intnonneg (optarg)) | 464 | warning_time = strtod (optarg, NULL); |
468 | usage4 (_("Warning threshold must be a positive integer")); | ||
469 | else | ||
470 | warning_time = strtod (optarg, NULL); | ||
471 | flags |= FLAG_TIME_WARN; | 465 | flags |= FLAG_TIME_WARN; |
472 | break; | 466 | break; |
473 | case 'C': | 467 | case 'C': |