diff options
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r-- | plugins/check_http.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c index 0746741c..0d499d93 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c | |||
@@ -154,7 +154,7 @@ main (int argc, char **argv) | |||
154 | usage4 (_("Could not parse arguments")); | 154 | usage4 (_("Could not parse arguments")); |
155 | 155 | ||
156 | if (display_html == TRUE) | 156 | if (display_html == TRUE) |
157 | printf ("<A HREF=\"%s://%s:%d%s\" target=\"_blank\">", | 157 | printf ("<A HREF=\"%s://%s:%d%s\" target=\"_blank\">", |
158 | use_ssl ? "https" : "http", host_name ? host_name : server_address, | 158 | use_ssl ? "https" : "http", host_name ? host_name : server_address, |
159 | server_port, server_url); | 159 | server_port, server_url); |
160 | 160 | ||
@@ -314,7 +314,7 @@ process_arguments (int argc, char **argv) | |||
314 | if (!strcmp (optarg, "critical")) | 314 | if (!strcmp (optarg, "critical")) |
315 | onredirect = STATE_CRITICAL; | 315 | onredirect = STATE_CRITICAL; |
316 | if (verbose) | 316 | if (verbose) |
317 | printf(_("option f:%d \n"), onredirect); | 317 | printf(_("option f:%d \n"), onredirect); |
318 | break; | 318 | break; |
319 | /* Note: H, I, and u must be malloc'd or will fail on redirects */ | 319 | /* Note: H, I, and u must be malloc'd or will fail on redirects */ |
320 | case 'H': /* Host Name (virtual host) */ | 320 | case 'H': /* Host Name (virtual host) */ |
@@ -417,7 +417,7 @@ process_arguments (int argc, char **argv) | |||
417 | exit (STATE_WARNING); | 417 | exit (STATE_WARNING); |
418 | } else | 418 | } else |
419 | max_page_len = atoi(tmp); | 419 | max_page_len = atoi(tmp); |
420 | } else | 420 | } else |
421 | min_page_len = atoi (optarg); | 421 | min_page_len = atoi (optarg); |
422 | break; | 422 | break; |
423 | } | 423 | } |
@@ -556,7 +556,7 @@ parse_time_string (const char *string) | |||
556 | if (tm.tm_mon < 0 || tm.tm_mday < 1 || tm.tm_mday > 31) | 556 | if (tm.tm_mon < 0 || tm.tm_mday < 1 || tm.tm_mday > 31) |
557 | return 0; | 557 | return 0; |
558 | 558 | ||
559 | /* | 559 | /* |
560 | This is actually wrong: we need to subtract the local timezone | 560 | This is actually wrong: we need to subtract the local timezone |
561 | offset from GMT from this value. But, that's ok in this usage, | 561 | offset from GMT from this value. But, that's ok in this usage, |
562 | because we only comparing these two GMT dates against each other, | 562 | because we only comparing these two GMT dates against each other, |
@@ -990,7 +990,7 @@ check_http (void) | |||
990 | elapsed_time = (double)microsec / 1.0e6; | 990 | elapsed_time = (double)microsec / 1.0e6; |
991 | die (onredirect, | 991 | die (onredirect, |
992 | _(" - %s - %.3f second response time %s|%s %s\n"), | 992 | _(" - %s - %.3f second response time %s|%s %s\n"), |
993 | status_line, elapsed_time, | 993 | status_line, elapsed_time, |
994 | (display_html ? "</A>" : ""), | 994 | (display_html ? "</A>" : ""), |
995 | perfd_time (elapsed_time), perfd_size (pagesize)); | 995 | perfd_time (elapsed_time), perfd_size (pagesize)); |
996 | } /* end if (http_status >= 300) */ | 996 | } /* end if (http_status >= 300) */ |
@@ -1006,7 +1006,7 @@ check_http (void) | |||
1006 | elapsed_time = (double)microsec / 1.0e6; | 1006 | elapsed_time = (double)microsec / 1.0e6; |
1007 | asprintf (&msg, | 1007 | asprintf (&msg, |
1008 | _(" - %s - %.3f second response time %s|%s %s\n"), | 1008 | _(" - %s - %.3f second response time %s|%s %s\n"), |
1009 | status_line, elapsed_time, | 1009 | status_line, elapsed_time, |
1010 | (display_html ? "</A>" : ""), | 1010 | (display_html ? "</A>" : ""), |
1011 | perfd_time (elapsed_time), perfd_size (pagesize)); | 1011 | perfd_time (elapsed_time), perfd_size (pagesize)); |
1012 | if (check_critical_time == TRUE && elapsed_time > critical_time) | 1012 | if (check_critical_time == TRUE && elapsed_time > critical_time) |
@@ -1043,9 +1043,9 @@ check_http (void) | |||
1043 | exit (STATE_OK); | 1043 | exit (STATE_OK); |
1044 | } | 1044 | } |
1045 | else if ((errcode == REG_NOMATCH && invert_regex == 0) || (errcode == 0 && invert_regex == 1)) { | 1045 | else if ((errcode == REG_NOMATCH && invert_regex == 0) || (errcode == 0 && invert_regex == 1)) { |
1046 | if (invert_regex == 0) | 1046 | if (invert_regex == 0) |
1047 | msg = strdup(_("pattern not found")); | 1047 | msg = strdup(_("pattern not found")); |
1048 | else | 1048 | else |
1049 | msg = strdup(_("pattern found")); | 1049 | msg = strdup(_("pattern found")); |
1050 | printf (("%s - %s%s|%s %s\n"), | 1050 | printf (("%s - %s%s|%s %s\n"), |
1051 | _("HTTP CRITICAL"), | 1051 | _("HTTP CRITICAL"), |
@@ -1118,7 +1118,7 @@ redir (char *pos, char *status_line) | |||
1118 | if (i == 0) { | 1118 | if (i == 0) { |
1119 | pos += (size_t) strcspn (pos, "\r\n"); | 1119 | pos += (size_t) strcspn (pos, "\r\n"); |
1120 | pos += (size_t) strspn (pos, "\r\n"); | 1120 | pos += (size_t) strspn (pos, "\r\n"); |
1121 | if (strlen(pos) == 0) | 1121 | if (strlen(pos) == 0) |
1122 | die (STATE_UNKNOWN, | 1122 | die (STATE_UNKNOWN, |
1123 | _("HTTP UNKNOWN - Could not find redirect location - %s%s\n"), | 1123 | _("HTTP UNKNOWN - Could not find redirect location - %s%s\n"), |
1124 | status_line, (display_html ? "</A>" : "")); | 1124 | status_line, (display_html ? "</A>" : "")); |
@@ -1151,7 +1151,7 @@ redir (char *pos, char *status_line) | |||
1151 | } | 1151 | } |
1152 | 1152 | ||
1153 | /* URI_HTTP URI_HOST URI_PATH */ | 1153 | /* URI_HTTP URI_HOST URI_PATH */ |
1154 | else if (sscanf (pos, HD2, type, addr, url) == 3 ) { | 1154 | else if (sscanf (pos, HD2, type, addr, url) == 3 ) { |
1155 | url = prepend_slash (url); | 1155 | url = prepend_slash (url); |
1156 | use_ssl = server_type_check (type); | 1156 | use_ssl = server_type_check (type); |
1157 | i = server_port_check (use_ssl); | 1157 | i = server_port_check (use_ssl); |
@@ -1181,7 +1181,7 @@ redir (char *pos, char *status_line) | |||
1181 | i = server_port; | 1181 | i = server_port; |
1182 | strcpy (type, server_type); | 1182 | strcpy (type, server_type); |
1183 | strcpy (addr, host_name ? host_name : server_address); | 1183 | strcpy (addr, host_name ? host_name : server_address); |
1184 | } | 1184 | } |
1185 | 1185 | ||
1186 | else { | 1186 | else { |
1187 | die (STATE_UNKNOWN, | 1187 | die (STATE_UNKNOWN, |