summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/check_http.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c
index dbaa0d78..a9c22389 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -1246,13 +1246,23 @@ check_http (void)
1246 if (strstr(header, header_expect) == NULL) { 1246 if (strstr(header, header_expect) == NULL) {
1247 // We did not find the header, the rest is for building the output and setting the state 1247 // We did not find the header, the rest is for building the output and setting the state
1248 char output_header_search[30] = ""; 1248 char output_header_search[30] = "";
1249
1249 strncpy(&output_header_search[0], header_expect, 1250 strncpy(&output_header_search[0], header_expect,
1250 sizeof(output_header_search)); 1251 sizeof(output_header_search));
1252
1251 if (output_header_search[sizeof(output_header_search) - 1] != '\0') { 1253 if (output_header_search[sizeof(output_header_search) - 1] != '\0') {
1252 bcopy("...", &output_header_search[sizeof(output_header_search) - 4], 1254 bcopy("...",
1253 4); 1255 &output_header_search[sizeof(output_header_search) - 4],
1256 4);
1254 } 1257 }
1255 xasprintf (&msg, _("%sheader '%s' not found on '%s://%s:%d%s', "), msg, output_header_search, use_ssl ? "https" : "http", host_name ? host_name : server_address, server_port, server_url); 1258
1259 xasprintf (&msg,
1260 _("%sheader '%s' not found on '%s://%s:%d%s', "),
1261 msg,
1262 output_header_search, use_ssl ? "https" : "http",
1263 host_name ? host_name : server_address, server_port,
1264 server_url);
1265
1256 result = STATE_CRITICAL; 1266 result = STATE_CRITICAL;
1257 } 1267 }
1258 } 1268 }