Skip to content

uala/haproxy-stats-visualizer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

Alt text

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.

About

A php app for visualize the status of multiple HaProxy instances.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.2%
  • Dockerfile 0.8%