diff options
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r-- | plugins/check_http.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c index c36d916..92861d9 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c | |||
@@ -1,9 +1,9 @@ | |||
1 | /***************************************************************************** | 1 | /***************************************************************************** |
2 | * | 2 | * |
3 | * Nagios check_http plugin | 3 | * Monitoring check_http plugin |
4 | * | 4 | * |
5 | * License: GPL | 5 | * License: GPL |
6 | * Copyright (c) 1999-2013 Nagios Plugins Development Team | 6 | * Copyright (c) 1999-2013 Monitoring Plugins Development Team |
7 | * | 7 | * |
8 | * Description: | 8 | * Description: |
9 | * | 9 | * |
@@ -35,7 +35,7 @@ | |||
35 | 35 | ||
36 | const char *progname = "check_http"; | 36 | const char *progname = "check_http"; |
37 | const char *copyright = "1999-2013"; | 37 | const char *copyright = "1999-2013"; |
38 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 38 | const char *email = "devel@monitoring-plugins.org"; |
39 | 39 | ||
40 | #include "common.h" | 40 | #include "common.h" |
41 | #include "netutils.h" | 41 | #include "netutils.h" |
@@ -57,7 +57,7 @@ enum { | |||
57 | 57 | ||
58 | #ifdef HAVE_SSL | 58 | #ifdef HAVE_SSL |
59 | int check_cert = FALSE; | 59 | int check_cert = FALSE; |
60 | int ssl_version; | 60 | int ssl_version = 0; |
61 | int days_till_exp_warn, days_till_exp_crit; | 61 | int days_till_exp_warn, days_till_exp_crit; |
62 | char *randbuff; | 62 | char *randbuff; |
63 | X509 *server_cert; | 63 | X509 *server_cert; |
@@ -157,7 +157,7 @@ main (int argc, char **argv) | |||
157 | /* Set default URL. Must be malloced for subsequent realloc if --onredirect=follow */ | 157 | /* Set default URL. Must be malloced for subsequent realloc if --onredirect=follow */ |
158 | server_url = strdup(HTTP_URL); | 158 | server_url = strdup(HTTP_URL); |
159 | server_url_length = strlen(server_url); | 159 | server_url_length = strlen(server_url); |
160 | xasprintf (&user_agent, "User-Agent: check_http/v%s (nagios-plugins %s)", | 160 | xasprintf (&user_agent, "User-Agent: check_http/v%s (monitoring-plugins %s)", |
161 | NP_VERSION, VERSION); | 161 | NP_VERSION, VERSION); |
162 | 162 | ||
163 | /* Parse extra opts if any */ | 163 | /* Parse extra opts if any */ |
@@ -257,7 +257,7 @@ process_arguments (int argc, char **argv) | |||
257 | } | 257 | } |
258 | 258 | ||
259 | while (1) { | 259 | while (1) { |
260 | c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:j:T:I:a:b:d:e:p:s:R:r:u:f:C:J:K:nlLS::m:M:N:E", longopts, &option); | 260 | c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:j:T:I:a:b:d:e:p:s:R:r:u:f:C:J:K:nlLS::m:M:NE", longopts, &option); |
261 | if (c == -1 || c == EOF) | 261 | if (c == -1 || c == EOF) |
262 | break; | 262 | break; |
263 | 263 | ||
@@ -339,10 +339,10 @@ process_arguments (int argc, char **argv) | |||
339 | case 'S': /* use SSL */ | 339 | case 'S': /* use SSL */ |
340 | #ifdef HAVE_SSL | 340 | #ifdef HAVE_SSL |
341 | enable_ssl: | 341 | enable_ssl: |
342 | /* ssl_version initialized to 0 as a default. Only set if it's non-zero. This helps when we include multiple | ||
343 | parameters, like -S and -C combinations */ | ||
342 | use_ssl = TRUE; | 344 | use_ssl = TRUE; |
343 | if (optarg == NULL || c != 'S') | 345 | if (c=='S' && optarg != NULL) { |
344 | ssl_version = 0; | ||
345 | else { | ||
346 | ssl_version = atoi(optarg); | 346 | ssl_version = atoi(optarg); |
347 | if (ssl_version < 1 || ssl_version > 3) | 347 | if (ssl_version < 1 || ssl_version > 3) |
348 | usage4 (_("Invalid option - Valid values for SSL Version are 1 (TLSv1), 2 (SSLv2) or 3 (SSLv3)")); | 348 | usage4 (_("Invalid option - Valid values for SSL Version are 1 (TLSv1), 2 (SSLv2) or 3 (SSLv3)")); |
@@ -1534,7 +1534,7 @@ print_help (void) | |||
1534 | 1534 | ||
1535 | printf (UT_WARN_CRIT); | 1535 | printf (UT_WARN_CRIT); |
1536 | 1536 | ||
1537 | printf (UT_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); | 1537 | printf (UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); |
1538 | 1538 | ||
1539 | printf (UT_VERBOSE); | 1539 | printf (UT_VERBOSE); |
1540 | 1540 | ||