diff options
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; |