diff options
author | tonvoon <ton.voon@opsview.com> | 2010-06-23 14:44:34 +0000 |
---|---|---|
committer | tonvoon <ton.voon@opsview.com> | 2010-06-23 14:44:34 +0000 |
commit | 1252195ed5cdf7b5f5fdc1fd5f2b09827a46f6ce (patch) | |
tree | 17fdee97da603cce596098bc86385165a940d5c0 /plugins/check_http.c | |
parent | 18f6835edaf7d640a2c9e476cb1babdbdadbfd9b (diff) | |
download | monitoring-plugins-1252195ed5cdf7b5f5fdc1fd5f2b09827a46f6ce.tar.gz |
Display missing search string and URL when failed (Duncan Ferguson #2999924)
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r-- | plugins/check_http.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c index 7f773c83..f08ad17c 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c | |||
@@ -100,6 +100,7 @@ int server_url_length; | |||
100 | int server_expect_yn = 0; | 100 | int server_expect_yn = 0; |
101 | char server_expect[MAX_INPUT_BUFFER] = HTTP_EXPECT; | 101 | char server_expect[MAX_INPUT_BUFFER] = HTTP_EXPECT; |
102 | char string_expect[MAX_INPUT_BUFFER] = ""; | 102 | char string_expect[MAX_INPUT_BUFFER] = ""; |
103 | char output_string_search[30] = ""; | ||
103 | double warning_time = 0; | 104 | double warning_time = 0; |
104 | int check_warning_time = FALSE; | 105 | int check_warning_time = FALSE; |
105 | double critical_time = 0; | 106 | double critical_time = 0; |
@@ -1037,7 +1038,11 @@ check_http (void) | |||
1037 | 1038 | ||
1038 | if (strlen (string_expect)) { | 1039 | if (strlen (string_expect)) { |
1039 | if (!strstr (page, string_expect)) { | 1040 | if (!strstr (page, string_expect)) { |
1040 | asprintf (&msg, _("%sstring not found, "), msg); | 1041 | strncpy(&output_string_search[0],string_expect,sizeof(output_string_search)); |
1042 | if(output_string_search[sizeof(output_string_search)-1]!='\0') { | ||
1043 | bcopy("...",&output_string_search[sizeof(output_string_search)-4],4); | ||
1044 | } | ||
1045 | asprintf (&msg, _("%sstring '%s' not found on '%s://%s:%d%s', "), msg, output_string_search, use_ssl ? "https" : "http", host_name ? host_name : server_address, server_port, server_url); | ||
1041 | result = STATE_CRITICAL; | 1046 | result = STATE_CRITICAL; |
1042 | } | 1047 | } |
1043 | } | 1048 | } |