anapsix/zabbix-haproxy

template uses wrong discovery command

oskapt opened this issue · 2 comments

Howdy. The template sets up discovery in the following format:

<key>haproxy.list.discovery[{$HAPROXY_SOCK},BACK]</key>

Your documentation says to use the following format:

anapsix@lb1:~$ sudo zabbix_agentd -t haproxy.list.discovery[BACKEND]

I had no discovery until I changed the template and removed {$HAPROXY_SOCK}, from the parameters. Zabbix was returning the following (my socket location is correct):

haproxy.list.discovery[/var/run/haproxy/haproxy.sock, [m|ZBX_NOTSUPPORTED]

{$HAPROXY_SOCK} is optional way to specify the location of the socket, since my assumption is not exactly common (but is that way for a purpose of making sure people explicitly set non-admin access on the socket)
Template's macro value can be changed from it's default to reflect your custom socket location.
Since no one else have reported this, and I'm pretty sure there would be plenty of reports if that is broken, I suspect there is something else going on.

Since you've "fixed" your issue, it's not a blocker for you anymore.
If you feel like you want to get to the bottom of this, enable debugging on an agent and try it both way to see where it breaks..

Yeah, disregard. I hardcoded the socket location in the script, so I skipped the part from the README about defining {$HAPROXY_SOCK} within Zabbix. Without that Zabbix was calling the discovery with an empty variable.