diff options
author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-07-31 10:28:45 +0000 |
---|---|---|
committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-07-31 10:28:45 +0000 |
commit | bc60456f87ecdf3aa650d0a989e1d5e657a94eb9 (patch) | |
tree | f107bc56b70c7ff62221aefc9bec6cca7caa74ea | |
parent | e8c797686a09548e906b723199deec22f112af1f (diff) | |
download | zabbix-bc60456f87ecdf3aa650d0a989e1d5e657a94eb9.tar.gz zabbix-bc60456f87ecdf3aa650d0a989e1d5e657a94eb9.tar.xz zabbix-bc60456f87ecdf3aa650d0a989e1d5e657a94eb9.zip |
- added timeout handler for http monitoring (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@4490 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/zabbix_server/httppoller/httptest.c | 27 |
2 files changed, 23 insertions, 5 deletions
@@ -13,6 +13,7 @@ Changes for 1.5: Changes for 1.4.2: + - added timeout handler for http monitoring (Eugene) - more informative report for confiuration script (Eugene) - changed installation directory to '$sbin' (Eudene) - fixed "Reset" button for Web screens (Eugene) diff --git a/src/zabbix_server/httppoller/httptest.c b/src/zabbix_server/httppoller/httptest.c index eab2adfa..72f88963 100644 --- a/src/zabbix_server/httppoller/httptest.c +++ b/src/zabbix_server/httppoller/httptest.c @@ -325,6 +325,9 @@ static void process_httptest(DB_HTTPTEST *httptest) now=time(NULL); while((row=DBfetch(result)) && !err_str) { + /* NOTE: do not use break or return for this block! + * process_step_data calling required! + */ ZBX_STR2UINT64(httpstep.httpstepid, row[0]); ZBX_STR2UINT64(httpstep.httptestid, row[1]); httpstep.no=atoi(row[2]); @@ -369,12 +372,26 @@ static void process_httptest(DB_HTTPTEST *httptest) lastfailedstep = httpstep.no; } } -/* if(CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_TIMEOUT, httpstep.timeout))) + if( !err_str ) { - zabbix_log(LOG_LEVEL_ERR, "Cannot set URL [%s]", curl_easy_strerror(err)); - ret = FAIL; - break; - }*/ + if(CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_TIMEOUT, httpstep.timeout))) + { + zabbix_log(LOG_LEVEL_ERR, "Cannot set TIMEOUT [%s]", + curl_easy_strerror(err)); + err_str = strdup(curl_easy_strerror(err)); + lastfailedstep = httpstep.no; + } + } + if( !err_str ) + { + if(CURLE_OK != (err = curl_easy_setopt(easyhandle, CURLOPT_CONNECTTIMEOUT, httpstep.timeout))) + { + zabbix_log(LOG_LEVEL_ERR, "Cannot set CONNECTTIMEOUT [%s]", + curl_easy_strerror(err)); + err_str = strdup(curl_easy_strerror(err)); + lastfailedstep = httpstep.no; + } + } if( !err_str ) { |