I found that the Web step timeouts where not working correctly. To fix this, I added 2 settings to the CURL function in the httptest.c file. From initial test, it seems to be working correctly. See additions below which are in red.
Notes on libCURL Setting Variables:
CURLOPT_TIMEOUT
Pass a long as parameter containing the maximum time in
seconds that you allow the libcurl transfer operation to
take. Normally, name lookups can take a considerable
time and limiting operations to less than a few minutes
risk aborting perfectly normal operations. This option
will cause curl to use the SIGALRM to enable time-outing
system calls.
CURLOPT_CONNECTTIMEOUT
Pass a long. It should contain the maximum time in sec*
onds that you allow the connection to the server to
take. This only limits the connection phase, once it
has connected, this option is of no more use. Set to
zero to disable connection timeout (it will then only
timeout on the system's internal timeouts). See also the
CURLOPT_TIMEOUT option.
if( !err_str )
{
zabbix_log(LOG_LEVEL_DEBUG, "WEBMonitor: Go to URL [%s]", httpstep.url);
if(CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_URL, httpstep.url)))
{
zabbix_log(LOG_LEVEL_ERR, "Cannot set URL [%s]",
curl_easy_strerror(err));
err_str = strdup(curl_easy_strerror(err));
lastfailedstep = httpstep.no;
}
}
if(CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_TIMEOUT, httpstep.timeout)))
{
zabbix_log(LOG_LEVEL_ERR, "Cannot set URL [%s]", curl_easy_strerror(err));
return FAIL;
break;
}
if(CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_CONNECTTIMEOUT, httpstep.timeout)))
{
zabbix_log(LOG_LEVEL_ERR, "Cannot set URL [%s]", curl_easy_strerror(err));
return FAIL;
break;
}
if( !err_str )
{
memset(&page, 0, sizeof(page));
if(CURLE_OK != (err = curl_easy_perform(easyhandle)))
{
zabbix_log(LOG_LEVEL_ERR, "Error doing curl_easy_perform [%s]",
curl_easy_strerror(err));
err_str = strdup(curl_easy_strerror(err));
lastfailedstep = httpstep.no;
}
else
{
{
zabbix_log(LOG_LEVEL_DEBUG, "WEBMonitor: Go to URL [%s]", httpstep.url);
if(CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_URL, httpstep.url)))
{
zabbix_log(LOG_LEVEL_ERR, "Cannot set URL [%s]",
curl_easy_strerror(err));
err_str = strdup(curl_easy_strerror(err));
lastfailedstep = httpstep.no;
}
}
if(CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_TIMEOUT, httpstep.timeout)))
{
zabbix_log(LOG_LEVEL_ERR, "Cannot set URL [%s]", curl_easy_strerror(err));
return FAIL;
break;
}
if(CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_CONNECTTIMEOUT, httpstep.timeout)))
{
zabbix_log(LOG_LEVEL_ERR, "Cannot set URL [%s]", curl_easy_strerror(err));
return FAIL;
break;
}
if( !err_str )
{
memset(&page, 0, sizeof(page));
if(CURLE_OK != (err = curl_easy_perform(easyhandle)))
{
zabbix_log(LOG_LEVEL_ERR, "Error doing curl_easy_perform [%s]",
curl_easy_strerror(err));
err_str = strdup(curl_easy_strerror(err));
lastfailedstep = httpstep.no;
}
else
{
CURLOPT_TIMEOUT
Pass a long as parameter containing the maximum time in
seconds that you allow the libcurl transfer operation to
take. Normally, name lookups can take a considerable
time and limiting operations to less than a few minutes
risk aborting perfectly normal operations. This option
will cause curl to use the SIGALRM to enable time-outing
system calls.
CURLOPT_CONNECTTIMEOUT
Pass a long. It should contain the maximum time in sec*
onds that you allow the connection to the server to
take. This only limits the connection phase, once it
has connected, this option is of no more use. Set to
zero to disable connection timeout (it will then only
timeout on the system's internal timeouts). See also the
CURLOPT_TIMEOUT option.
Comment