anapsix / zabbix-haproxy

HAProxy Zabbix Discovery and Template
170 stars 77 forks source link

Cant make it work #37

Closed Canos closed 6 years ago

Canos commented 7 years ago

I've followed every single step of the README, but server is not descovering any items.

I have some newbie questions:

Thanks

anapsix commented 7 years ago

both scripts should be on the node where haproxy is installed; same node must have zabbix agent as well. try running discovery script manually as zabbix user on the node with haproxy, as part of debug. if you are getting data, you are most of the way there, if not - start verifying permissions on the haproxy info socket

usergoodvery commented 7 years ago

hi I am on 3.2 and cannot see discovered items. I only see three (checkum, memory used, number of running processes).

These types of commands work though, returning right info from the socket: /opt/zabbix/bin/haproxy_discovery.sh SERVERS sudo zabbix_agentd -t 'haproxy.list.discovery[SERVERS]'

The only thing I changed is the location of the scripts, but I updated userparameter_haproxy.conf with the new path.

regards

anapsix commented 7 years ago

@usergoodvery, if you test with sudo you might break the cache file, by having it owned by root.. make sure to test with sudo -u zabbix "..." or whatever user zabbix agent is running as

usergoodvery commented 7 years ago

thanks for the hint I tried that mode and it works... but that shouldn't be the reason why items are'nt showing? as I am till not seeing anything other than the 3 items I reported above

anapsix commented 7 years ago

It would cause problems, if cache file belongs to root and Zabbix user cannot overwrite it.. Try adjusting discovery interval, cause it's not very frequent - regularly once an hour. Try debugging via zabbix_agentd ... command (make sure to run it as Zabbix user)

usergoodvery commented 7 years ago

OK well where do these cache zombies sit on the file system? For what's worth, I only did that raw sudo on one instance, I have other instance which is not showing items either... I wonder if it is 3.2 compatibility issue as your description seems to say the template was tested on 2.4. I am pretty sure I uploaded the 3.x template

anapsix commented 7 years ago

Highly unlikely problem with 3.2 - others would've reported it.. And.. yeah, discovery is not cached.. so, something else.. Enable debugging in Zabbix agent and watch the log.. also, try discovery via zabbix_agentd command.. look inside the script, it's quite simple.. check permissions on the script, directory..

usergoodvery commented 7 years ago

Thanks I'll enable logging... what's perplexing is that both the script and zabbix_agentd return the right discovery information...

anapsix commented 7 years ago

perhaps related to #38 and #41

... zabbix user did not have required binaries in the path.. make sure zabbix user has all the required binaries (such as nc / socat) in PATH (e.g include /bin and /sbin in PATH)

anapsix commented 6 years ago

going to assume it all worked out