A php app for visualize the status of multiple HaProxy instances.
For every haproxy configured, it will show the current status of backend servers with:
- Status
- Uptime
- LastCheck
- Downtime
For use this app, every haproxy instance has to expose statistics.
You can do it editing haproxy.cfg with:
listen stats
bind :9000
mode http
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats uri /lb_stats
stats auth user:password
stats refresh 5s
This app works inside docker, so to use it simple run it with:
docker run -d -p 80:80 -e HAPROXY_BASE_URL=https://haproxy.domain.com -e HAPROXY_PATHS=lb_stats1,lb_stats2 leen15/haproxy-stats-visualizer
And now if you open the new page it will show a section for every HaProxy Instance.
You have to set these environment variables:
HAPROXY_BASE_URL
: base url where you have your haproxy stats pages (it also support basic auth with user:[email protected]/)
HAPROXY_PATHS
: A list of paths where haproxy stats are exposed (comma separated)
REFRESH_INTERVAL
: For autorefresh (Default value 5 seconds)
The app also support envs with a full URLs, like this:
LB_URL_1=B2B_Balancer#https://haproxy1.domain.com/haproxy_stats
LB_URL_2=B2C_Balancer#https://haproxy2.domain.com/haproxy_stats
The format is:
LB_URL_{OrderCounter}={Name_Of_Balancer}#{Url.of.haproxy}
For the name field underscores will be replace with spaces.
This project is released under the terms of the MIT license.