sensu-plugins / sensu-plugins-haproxy

This plugin provides native HAProxy instrumentation for monitoring and metrics collection, including: service health and backend server metrics.
http://sensu-plugins.io
MIT License
11 stars 37 forks source link

Unable to fetch stats from haproxy after 3 attempts #28

Open MrMoronIV opened 6 years ago

MrMoronIV commented 6 years ago

Command: metrics-haproxy.rb -c /var/lib/haproxy/stats

Even when I provide username and password the result is still: Unable to fetch stats from haproxy after 3 attempts

When I run the metrics command on the command line it gives me stats perfectly fine, the socket is chmod 755.

Any suggestions? Literally all sensu checks work on this server except this one.

Pshellvon commented 4 years ago

In my case: metrics-haproxy.rb -c /var/run/haproxy/admin.sock -a working like a charm!

phumpal commented 4 years ago

@MrMoronIV does the user executing the metrics check have permission to introspect the haproxy socket?

My workaround was to use rvmsudo. e.g.

rvmsudo metrics-haproxy.rb -c /run/haproxy/admin.sock -a