How to monitor HAProxy

haproxy

We have two HAProxy servers using keapalived for failover. Once one goes down, the other one takes over seamlessly.

I know it is possible to configure HAProxy to send an email to alert a sysadmin, but it would also be helpful to see the health n the HAProxy statistics page where all monitored services are displayed. (hostname:1936/?stats).

Is this possible? Currently we don't even know which one of the servers is serving the stats page.

Best Answer

If all you want to know is which node is the active one, then look at using the stats show-node directive.

Add it to your stats section and you're good to go.