diff options
author | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | 2003-06-30 19:47:21 +0000 |
---|---|---|
committer | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | 2003-06-30 19:47:21 +0000 |
commit | f813c747a264906c066d85d220e7b0f4aab3e046 (patch) | |
tree | ba8dd633c0a5b5e92355adb606d190cd0863023b /plugins/check_http.c | |
parent | 97634d8fc6bba849f771eda24106d88104e703b9 (diff) | |
download | monitoring-plugins-f813c747a264906c066d85d220e7b0f4aab3e046.tar.gz |
Added -4 and -6 command line options into check_http, check_ldap and
check_smtp
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@575 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r-- | plugins/check_http.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c index 468e4c22..038ac68a 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c | |||
@@ -45,13 +45,17 @@ certificate expiration times.\n" | |||
45 | [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n\ | 45 | [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n\ |
46 | [-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>]\n\ | 46 | [-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>]\n\ |
47 | [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n\ | 47 | [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n\ |
48 | [-P string] [-m min_pg_size]" | 48 | [-P string] [-m min_pg_size] [-4|-6]" |
49 | 49 | ||
50 | #define LONGOPTIONS "\ | 50 | #define LONGOPTIONS "\ |
51 | -H, --hostname=ADDRESS\n\ | 51 | -H, --hostname=ADDRESS\n\ |
52 | Host name argument for servers using host headers (virtual host)\n\ | 52 | Host name argument for servers using host headers (virtual host)\n\ |
53 | -I, --IP-address=ADDRESS\n\ | 53 | -I, --IP-address=ADDRESS\n\ |
54 | IP address or name (use numeric address if possible to bypass DNS lookup).\n\ | 54 | IP address or name (use numeric address if possible to bypass DNS lookup).\n\ |
55 | -4, --use-ipv4\n\ | ||
56 | Use IPv4 protocol\n\ | ||
57 | -6, --use-ipv6\n\ | ||
58 | Use IPv6 protocol\n\ | ||
55 | -e, --expect=STRING\n\ | 59 | -e, --expect=STRING\n\ |
56 | String to expect in first (status) line of server response (default: %s)\n\ | 60 | String to expect in first (status) line of server response (default: %s)\n\ |
57 | If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)\n\ | 61 | If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)\n\ |
@@ -316,6 +320,8 @@ process_arguments (int argc, char **argv) | |||
316 | {"onredirect", required_argument, 0, 'f'}, | 320 | {"onredirect", required_argument, 0, 'f'}, |
317 | {"certificate", required_argument, 0, 'C'}, | 321 | {"certificate", required_argument, 0, 'C'}, |
318 | {"min", required_argument, 0, 'm'}, | 322 | {"min", required_argument, 0, 'm'}, |
323 | {"use-ipv4", no_argument, 0, '4'}, | ||
324 | {"use-ipv6", no_argument, 0, '6'}, | ||
319 | {0, 0, 0, 0} | 325 | {0, 0, 0, 0} |
320 | }; | 326 | }; |
321 | 327 | ||
@@ -336,7 +342,7 @@ process_arguments (int argc, char **argv) | |||
336 | } | 342 | } |
337 | 343 | ||
338 | while (1) { | 344 | while (1) { |
339 | c = getopt_long (argc, argv, "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:", long_options, &option_index); | 345 | c = getopt_long (argc, argv, "Vvh46t:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:", long_options, &option_index); |
340 | if (c == -1 || c == EOF) | 346 | if (c == -1 || c == EOF) |
341 | break; | 347 | break; |
342 | 348 | ||
@@ -464,6 +470,16 @@ process_arguments (int argc, char **argv) | |||
464 | } | 470 | } |
465 | break; | 471 | break; |
466 | #endif | 472 | #endif |
473 | case '4': | ||
474 | address_family = AF_INET; | ||
475 | break; | ||
476 | case '6': | ||
477 | #ifdef USE_IPV6 | ||
478 | address_family = AF_INET6; | ||
479 | #else | ||
480 | usage ("IPv6 support not available\n"); | ||
481 | #endif | ||
482 | break; | ||
467 | case 'v': /* verbose */ | 483 | case 'v': /* verbose */ |
468 | verbose = TRUE; | 484 | verbose = TRUE; |
469 | break; | 485 | break; |