anapsix / zabbix-haproxy

HAProxy Zabbix Discovery and Template
170 stars 77 forks source link

Documentation on user parameters #3

Closed deviantony closed 9 years ago

deviantony commented 9 years ago

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!

deviantony commented 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 ;)

anapsix commented 9 years ago

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.

anapsix commented 9 years ago

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.

deviantony commented 9 years ago

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:

anapsix commented 9 years ago

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..

deviantony commented 9 years ago

I was not able to access the stats via the template. It barely exposes a few items...

zabbix

anapsix commented 9 years ago

Perhaps discovery didn't work. Try running my manual discovery check example via zabbix -c command

anapsix commented 9 years ago

@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]
anapsix commented 9 years ago

@deviantony I've updated both: userparameter_haproxy.conf and haproxy_discovery.sh with some of examples and explanation of arguments - hope this helps.

deviantony commented 9 years ago

Nice :+1: