Index: src/zabbix_server/httppoller/httptest.c
===================================================================
--- src/zabbix_server/httppoller/httptest.c	(revision 51352)
+++ src/zabbix_server/httppoller/httptest.c	(working copy)
@@ -378,6 +378,8 @@
 			httptest->httptest.httptestid);
 
 #ifdef HAVE_LIBCURL
+	zabbix_log(LOG_LEVEL_DEBUG, "%s() before cURL library initialization", __function_name);
+
 	if (NULL == (easyhandle = curl_easy_init()))
 	{
 		err_str = zbx_strdup(err_str, "cannot initialize cURL library");
@@ -384,6 +386,8 @@
 		goto clean;
 	}
 
+	zabbix_log(LOG_LEVEL_DEBUG, "%s() cURL library successfully initialized", __function_name);
+
 	if (CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_PROXY, httptest->httptest.http_proxy)) ||
 			CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_COOKIEFILE, "")) ||
 			CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_USERAGENT, httptest->httptest.agent)) ||
@@ -396,11 +400,15 @@
 			CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_ERRORBUFFER, errbuf)))
 	{
 		err_str = zbx_strdup(err_str, curl_easy_strerror(err));
+		zabbix_log(LOG_LEVEL_DEBUG, "%s() cannot set one of cURL options: %s", __function_name, err_str);
 		goto clean;
 	}
 
+	zabbix_log(LOG_LEVEL_DEBUG, "%s() cURL library options successfully set", __function_name);
+
 	if (0 != httptest->httptest.verify_peer && NULL != CONFIG_SSL_CA_LOCATION)
 	{
+		zabbix_log(LOG_LEVEL_DEBUG, "using SSL CA location: '%s'", CONFIG_SSL_CA_LOCATION);
 		if (CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_CAPATH, CONFIG_SSL_CA_LOCATION)))
 		{
 			err_str = zbx_strdup(err_str, curl_easy_strerror(err));
@@ -408,6 +416,8 @@
 		}
 	}
 
+	zabbix_log(LOG_LEVEL_DEBUG, "%s() SSL CA location successfully set", __function_name);
+
 	if ('\0' != *httptest->httptest.ssl_cert_file)
 	{
 		char	*file_name;
@@ -425,6 +435,8 @@
 		}
 	}
 
+	zabbix_log(LOG_LEVEL_DEBUG, "%s() SSL cert location successfully set", __function_name);
+
 	if ('\0' != *httptest->httptest.ssl_key_file)
 	{
 		char	*file_name;
@@ -442,6 +454,8 @@
 		}
 	}
 
+	zabbix_log(LOG_LEVEL_DEBUG, "%s() SSL key location successfully set", __function_name);
+
 	if ('\0' != httptest->httptest.ssl_key_password)
 	{
 		if (CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_KEYPASSWD,
@@ -452,6 +466,8 @@
 		}
 	}
 
+	zabbix_log(LOG_LEVEL_DEBUG, "%s() SSL key password successfully set", __function_name);
+
 	while (NULL != (row = DBfetch(result)))
 	{
 		struct curl_slist	*headers_slist = NULL;
@@ -460,6 +476,9 @@
 		/*       process_step_data() call is required! */
 
 		ZBX_STR2UINT64(httpstep.httpstepid, row[0]);
+
+		zabbix_log(LOG_LEVEL_DEBUG, "%s() processing httpstepid:'%s'", __function_name, row[0]);
+
 		httpstep.httptestid = httptest->httptest.httptestid;
 		httpstep.no = atoi(row[1]);
 		httpstep.name = row[2];
@@ -468,6 +487,8 @@
 		substitute_simple_macros(NULL, NULL, NULL, NULL, NULL, host, NULL,
 				&httpstep.url, MACRO_TYPE_HTTPTEST_FIELD, NULL, 0);
 
+		zabbix_log(LOG_LEVEL_DEBUG, "%s() macros in URL substituted: '%s'", __function_name, httpstep.url);
+
 		httpstep.timeout = atoi(row[4]);
 
 		httpstep.posts = zbx_strdup(NULL, row[5]);
@@ -474,14 +495,22 @@
 		substitute_simple_macros(NULL, NULL, NULL, NULL, NULL, host, NULL,
 				&httpstep.posts, MACRO_TYPE_HTTPTEST_FIELD, NULL, 0);
 
+		zabbix_log(LOG_LEVEL_DEBUG, "%s() macros in POST substituted: '%s'", __function_name, httpstep.posts);
+
 		httpstep.required = zbx_strdup(NULL, row[6]);
 		substitute_simple_macros(NULL, NULL, NULL, NULL, NULL, host, NULL,
 				&httpstep.required, MACRO_TYPE_HTTPTEST_FIELD, NULL, 0);
 
+		zabbix_log(LOG_LEVEL_DEBUG, "%s() macros in required string substituted: '%s'", __function_name,
+				httpstep.required);
+
 		httpstep.status_codes = zbx_strdup(NULL, row[7]);
 		substitute_simple_macros(NULL, NULL, NULL, NULL, &host->hostid, NULL, NULL,
 				&httpstep.status_codes, MACRO_TYPE_COMMON, NULL, 0);
 
+		zabbix_log(LOG_LEVEL_DEBUG, "%s() macros in status codes substituted: '%s'", __function_name,
+				httpstep.status_codes);
+
 		httpstep.variables = row[8];
 		httpstep.follow_redirects = atoi(row[9]);
 		httpstep.retrieve_mode = atoi(row[10]);
@@ -490,11 +519,19 @@
 		substitute_simple_macros(NULL, NULL, NULL, NULL, NULL, host, NULL,
 				&httpstep.headers, MACRO_TYPE_HTTPTEST_FIELD, NULL, 0);
 
+		zabbix_log(LOG_LEVEL_DEBUG, "%s() macros in headers substituted: '%s'", __function_name,
+				httpstep.headers);
+
 		memset(&stat, 0, sizeof(stat));
 
 		http_substitute_variables(httptest, &httpstep.url);
+
+		zabbix_log(LOG_LEVEL_DEBUG, "%s() variables in URL substituted: '%s'", __function_name, httpstep.url);
+
 		http_substitute_variables(httptest, &httpstep.posts);
 
+		zabbix_log(LOG_LEVEL_DEBUG, "%s() variables in POST substituted: '%s'", __function_name, httpstep.posts);
+
 		zabbix_log(LOG_LEVEL_DEBUG, "%s() use step \"%s\"", __function_name, httpstep.name);
 
 		if (CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_POSTFIELDS, httpstep.posts)))
@@ -702,6 +739,8 @@
 	zbx_free(auth);
 clean:
 	curl_easy_cleanup(easyhandle);
+
+	zabbix_log(LOG_LEVEL_DEBUG, "%s() all scenario steps executed", __function_name);
 #else
 	err_str = zbx_strdup(err_str, "cURL library is required for Web monitoring support");
 #endif	/* HAVE_LIBCURL */
