In our environment we have some JEE applications with web frontends, which have 8 hours long HTTP session timeouts. With every Web check, Zabbix causes a new session created, because cookies with JSESSIONID are not saved between the checks. By the end of the day it may become an issue, since every session needs some JVM resources. I modified zabbix-1.8.10/src/zabbix_server/httppoller/httptest.c as follows:
272,276c272
< char cookie_file[500];
< zbx_snprintf( cookie_file, sizeof(cookie_file), "%s%d", "/opt/local/ems/zabbix/scripts/cookies/", httptest->httptestid );
<
< if (CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_COOKIEFILE, cookie_file )) ||
< CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_COOKIEJAR, cookie_file )) ||
---
> if (CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_COOKIEFILE, "")) ||
With this patch, zabbix server saves cookies in /opt/local/ems/zabbix/scripts/cookies/ and doesn't add new HTTP sessions.
272,276c272
< char cookie_file[500];
< zbx_snprintf( cookie_file, sizeof(cookie_file), "%s%d", "/opt/local/ems/zabbix/scripts/cookies/", httptest->httptestid );
<
< if (CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_COOKIEFILE, cookie_file )) ||
< CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_COOKIEJAR, cookie_file )) ||
---
> if (CURLE_OK != (err = curl_easy_setopt(easyhandle, opt = CURLOPT_COOKIEFILE, "")) ||
With this patch, zabbix server saves cookies in /opt/local/ems/zabbix/scripts/cookies/ and doesn't add new HTTP sessions.