summaryrefslogtreecommitdiffstats
path: root/plugins/check_curl.c
diff options
context:
space:
mode:
authorSven Nierlein <sven@nierlein.de>2021-04-07 09:49:10 (GMT)
committerGitHub <noreply@github.com>2021-04-07 09:49:10 (GMT)
commit10337247973e9fad8a5fed6fc5e78b0637326237 (patch)
treee5f4e71ae72b376095586e3a9ac4f44d6d0a362f /plugins/check_curl.c
parent2e5b38cc832c3e818b43515636e04b7218e6f995 (diff)
parent2482950e267a752b37d696c10ea091dc62d6d8a7 (diff)
downloadmonitoring-plugins-10337247973e9fad8a5fed6fc5e78b0637326237.tar.gz
Merge pull request #1668 from bazzisoft/master
Update check_curl.c to display a specific human-readable error message where possible
Diffstat (limited to 'plugins/check_curl.c')
-rw-r--r--plugins/check_curl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index 9f1eafa..ee9c8b1 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -313,8 +313,8 @@ static char *string_statuscode (int major, int minor)
313 /* assuming here HTTP/N with N>=4 */ 313 /* assuming here HTTP/N with N>=4 */
314 snprintf (buf, sizeof (buf), "HTTP/%d", major); 314 snprintf (buf, sizeof (buf), "HTTP/%d", major);
315 break; 315 break;
316 } 316 }
317 317
318 return buf; 318 return buf;
319} 319}
320 320
@@ -662,7 +662,7 @@ check_http (void)
662 /* Curl errors, result in critical Nagios state */ 662 /* Curl errors, result in critical Nagios state */
663 if (res != CURLE_OK) { 663 if (res != CURLE_OK) {
664 snprintf (msg, DEFAULT_BUFFER_SIZE, _("Invalid HTTP response received from host on port %d: cURL returned %d - %s"), 664 snprintf (msg, DEFAULT_BUFFER_SIZE, _("Invalid HTTP response received from host on port %d: cURL returned %d - %s"),
665 server_port, res, curl_easy_strerror(res)); 665 server_port, res, errbuf[0] ? errbuf : curl_easy_strerror(res));
666 die (STATE_CRITICAL, "HTTP CRITICAL - %s\n", msg); 666 die (STATE_CRITICAL, "HTTP CRITICAL - %s\n", msg);
667 } 667 }
668 668