the zabbix agentd doesn't enable curl option (this causes removal of https checks). The message one can see is: Support for HTTPS check was not compiled in. The problem probably affects other zabbix agent versions too. I successfully patched Makefiles for zabbix34-agent and zabbix34-server (master port) but I'm not sure if it's the right thing to do with master/slave ports. agent: --- Makefile.orig 2019-01-10 15:15:54.828171000 +0100 +++ Makefile 2019-01-10 15:16:10.502148000 +0100 @@ -8,7 +8,7 @@ MASTERDIR= ${.CURDIR}/../zabbix34-server PLIST= ${PKGDIR}/pkg-plist.agent -OPTIONS_DEFINE= IPV6 +OPTIONS_DEFINE= IPV6 CURL OPTIONS_DEFAULT= OPENSSL .include "${MASTERDIR}/Makefile" server: --- Makefile.orig 2019-01-10 21:25:44.617241000 +0100 +++ Makefile 2019-01-10 15:22:39.515339000 +0100 @@ -124,6 +124,9 @@ .elif ${ZABBIX_BUILD} == "agent" OPTIONS_SINGLE= SSL OPTIONS_SINGLE_SSL= OPENSSL GNUTLS +CURL_DESC= Support for web monitoring +CURL_CONFIGURE_WITH= libcurl +CURL_LIB_DEPENDS= libcurl.so:ftp/curl .endif # if ${ZABBIX_BUILD} != "agent" && ${ZABBIX_BUILD} != "java" IPV6_CONFIGURE_ENABLE= ipv6
The curl options is huge so off by default. If you are strictly using packages, I would suggest using poudriere [1] to create a custom package repository, allowing you to customise port OPTIONS while continuing to use packages.
(In reply to pg from comment #1) I do not care if it's on or off by default. It just doesn't exist in -agent port (it's available only in -server port). I also don't use packages.
net-mgmt/zabbix24-agent||2017-05-29|Has expired: Upstream has declared this version EoL in 2016 (Q1).
Sorry , I read it wrong (24 instead of 34).
(In reply to Marcin Gryszkalis from comment #2) Hi. Actually, CURL is enabled by default on server/proxy. Where and how did you get this message? "Support for HTTPS check was not compiled in." As far I'm concerned, Web monitoring is made through Proxy/Servers, not through the agent. I'll appreciate if you can help me simulate this on my machine (Zabbix 4). Just a note: I checked agent packages distributed by Zabbix LLC and they are linked with libcurl, but I didn't find any reference to curl in the zabbix_agent source code, just in Makefile.
Couldn't reproduce, if you have more information, please, reopen this PR. Thank you!
It's not for web scenarios but for net.tcp.service with service == 'https' Note that you can have net.tcp.service check as agent-side check. in ./libs/zbxsysinfo/simple/simple.c 308 int check_service(AGENT_REQUEST *request, const char *default_addr, AGENT_RESULT *result, int perf) 309 { 344 if (0 == strncmp("net.tcp.service", get_rkey(request), 15)) 345 { 407 else if (0 == strcmp(service, "https")) 408 { 409 #ifdef HAVE_LIBCURL 410 if (NULL == port_str || '\0' == *port_str) 411 port = ZBX_DEFAULT_HTTPS_PORT; 412 ret = check_https(ip, port, CONFIG_TIMEOUT, &value_int); 413 #else 414 SET_MSG_RESULT(result, zbx_strdup(NULL, "Support for HTTPS check was not compiled in.")); 415 #endif 416 } % strings /usr/local/sbin/zabbix_agentd | grep HTTPS.check Support for HTTPS check was not compiled in.
Created attachment 202838 [details] net.tcp.service on agent prototype I use it as prototype in autodiscovery but it can be ordinary item too.
You can also easily test it with zabbix_get standard: % zabbix_get -s 127.0.0.1 -k 'net.tcp.service[https,google.com]' ZBX_NOTSUPPORTED: Support for HTTPS check was not compiled in. patched and linked with curl: % zabbix_get -s 127.0.0.1 -k 'net.tcp.service[https,google.com'] 1
(In reply to Marcin Gryszkalis from comment #9) Good catch, thanks for the information. So, makes sense to have CURL option on all versions of zabbix-agent.
Created attachment 203066 [details] zabbix-agent-cURL.patch Add option CURL on all zabbix agent
Comment on attachment 203066 [details] zabbix-agent-cURL.patch Approved, thanks!
A commit references this bug: Author: dbaio Date: Wed Mar 27 11:37:12 UTC 2019 New revision: 496943 URL: https://svnweb.freebsd.org/changeset/ports/496943 Log: net-mgmt/zabbix*-agent: Add libcurl support This enables zabbix_agent simple_checks (net.tcp.service) for https. PR: 234831 Reported by: Marcin Gryszkalis <mg@fork.pl> Approved by: Pakhom Golynga <pg@pakhom.spb.ru> (maintainer) Changes: head/net-mgmt/zabbix22-agent/Makefile head/net-mgmt/zabbix22-server/Makefile head/net-mgmt/zabbix3-agent/Makefile head/net-mgmt/zabbix3-server/Makefile head/net-mgmt/zabbix32-agent/Makefile head/net-mgmt/zabbix32-server/Makefile head/net-mgmt/zabbix34-agent/Makefile head/net-mgmt/zabbix34-server/Makefile head/net-mgmt/zabbix4-agent/Makefile head/net-mgmt/zabbix4-server/Makefile
Committed, thanks!