[monitoring-plugins] fixed setting host_name or server_address in curl ...

Andreas Baumann git at monitoring-plugins.org
Thu Apr 27 10:10:12 CEST 2017


 Module: monitoring-plugins
 Branch: feature_check_curl
 Commit: 051754ef51343c67ba817fb21ac8b02603462558
 Author: Andreas Baumann <mail at andreasbaumann.cc>
   Date: Thu Apr 27 10:04:47 2017 +0200
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=051754e

fixed setting host_name or server_address in curl URL option

---

 plugins/check_curl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index e26d8d3..cd00b0e 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -325,7 +325,7 @@ check_http (void)
 
   /* compose URL */
   snprintf (url, DEFAULT_BUFFER_SIZE, "%s://%s%s", use_ssl ? "https" : "http",
-    host_name, server_url);
+    host_name ? host_name : server_address, server_url);
   handle_curl_option_return_code (curl_easy_setopt (curl, CURLOPT_URL, url), "CURLOPT_URL");
 
   /* set port */



More information about the Commits mailing list