diff options
author | Barak Shohat <barak@bazzisoft.com> | 2021-04-06 16:35:20 +0300 |
---|---|---|
committer | Jan Wagner <waja@cyconet.org> | 2021-04-10 13:43:12 +0200 |
commit | e7598ae6377659430f38a5360aeb09d8a26b8e1a (patch) | |
tree | 499240e424e56dfe3073d7290f42d0d44cb1a6b7 /plugins/check_curl.c | |
parent | 2bb6abb501cdcace5808fad89f1941f36c69fbf5 (diff) | |
download | monitoring-plugins-e7598ae6377659430f38a5360aeb09d8a26b8e1a.tar.gz |
Updated 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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c index 9f1eafa2..ee9c8b1d 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 | ||