Closed deviantony closed 9 years ago
Ok google helped me here, found the solution in this post: https://www.zabbix.com/forum/showthread.php?t=47467
But I guess you could add it to the README ;)
I see the trouble.. I believe I mention the nessecity of setting proper socket permissions. Perhaps, I should make it more clear. Thanks for the feedback.
I guess I did not.. :(
So, when your HAProxy creates a socket for stats, you can set permission mask for it in haproxy.conf
. When using non-admin socket for stats, it's safe to allow very loose permissions (0666). You can even use something more restrictive like 0660, as long as you add Zabbix Agent's running user to the HAProxy group (usually "haproxy").
This way you don't have to have socat running with sudo
. Don't have to create /etc/sudoers/
entry for Zabbix. Don't need to remember to make it restrictive. And avoid all implication of misconfiguring use of sudo
Will update README to note required socket access.
No my problem was not related to the permissions, just the fact that you need to precise the following parameters for the user parameter functions:
Ah.. I suppose, the expectation was that you would use the template to access the stats. But I see how it could be helpful to understand how it works. I'll add few explicit examples to README..
I was not able to access the stats via the template. It barely exposes a few items...
Perhaps discovery didn't work.
Try running my manual discovery check example via zabbix -c
command
@deviantony do you get anything from these?
sudo zabbix_agentd -t haproxy.list.discovery[FRONTEND]
sudo zabbix_agentd -t haproxy.list.discovery[BACKEND]
sudo zabbix_agentd -t haproxy.list.discovery[SERVERS]
@deviantony I've updated both: userparameter_haproxy.conf
and haproxy_discovery.sh
with some of examples and explanation of arguments - hope this helps.
Nice :+1:
Hey there,
I'd like to know how to use the user parameters defined in _userparameterhaproxy.conf? I'm guessing it needs 3 parameters but can't to find which one.
Good job anyway!