https://github.com/leen15/haproxy-stats-visualizer
A php app for visualize the status of multiple HaProxy instances.
https://github.com/leen15/haproxy-stats-visualizer
docker haproxy metrics statistics visualizer
Last synced: about 1 year ago
JSON representation
A php app for visualize the status of multiple HaProxy instances.
- Host: GitHub
- URL: https://github.com/leen15/haproxy-stats-visualizer
- Owner: Leen15
- Created: 2020-01-27T18:09:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-03T14:28:54.000Z (almost 3 years ago)
- Last Synced: 2025-03-27T06:44:40.612Z (about 1 year ago)
- Topics: docker, haproxy, metrics, statistics, visualizer
- Language: PHP
- Homepage:
- Size: 153 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HaProxy Stats Visualizer
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

## Prerequisites:
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
```
## Usage
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.
## Environment Variables
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:pass@yourdomain.com/)
`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.
## License
This project is released under the terms of the [MIT license](http://en.wikipedia.org/wiki/MIT_License).