OpsDash
Search…
HAProxy Monitoring
Quick Start
1. Install the OpsDash Smart Agent on the Apache or Nginx server that you wish to monitor. If you need instructions for how to do this, here they are: Debian/Ubuntu, CentOS/RHEL, Generic.
2. Edit the OpsDash Smart Agent configuration file at /etc/opsdash/agent.cfg and add a new service:
1
# choose a good, unique name for the service (here my-haproxy-1 is used)
2
service "my-haproxy-1" {
3
type = "haproxy"
4
5
# point to the HTTP URL for the stats page
6
url = "http://127.0.0.1:9999/haproxy?stats"
7
# you can also set the username and password if you have basic auth for the URL
8
#user = "myuser"
9
#pass = "mypass"
10
11
# you can also use the stats socket instead of the HTTP URL:
12
# url = "unix:///var/lib/haproxy/stats"
13
}
Copied!
3. Reload the OpsDash Smart Agent so that it picks up the new configuration:
1
sudo service opsdash-agent reload
Copied!
4. You should see the service my-haproxy-1 appear under https://app.opsdash.com/sources within a minute or so. Clicking on it should take you to the dashboard at https://app.opsdash.com/source/my-haproxy-1. If it does not, check the agent log file at /var/log/opsdash/agent.log.
HAProxy Configuration
OpsDash supports HAProxy 1.4 and above. Please refer the HAProxy documentation for all the options. Typically, the relevant parts of the configuration are something like this:
1
global
2
stats socket /var/lib/haproxy/stats
3
4
listen stats
5
bind 127.0.0.1:9999
6
mode http
7
stats enable
8
stats uri /haproxy?stats
9
stats auth myuser:mypass
Copied!
Last modified 3yr ago
Copy link