diff options
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-03-21 02:39:49 -0400 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-03-21 02:39:49 -0400 |
commit | 795277d9b1bf7c6d7539b4f1aac3815e6b66efe7 (patch) | |
tree | a947be7ead12c071d2387c70d689d603098c3072 | |
parent | e7cdcfee2a6025b41f67ead5020df3965ef05a98 (diff) | |
download | monitoring-plugins-795277d9b1bf7c6d7539b4f1aac3815e6b66efe7.tar.gz |
check_http: die when an invalid --onredirect option is specified
-rw-r--r-- | plugins/check_http.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c index 5a859f98..c8ae67f8 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c @@ -305,18 +305,19 @@ process_arguments (int argc, char **argv) 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; |