Implement monitoring service in HA Proxy load balancer which can automatically shut down haproxy server when all its backend web servers are down and automatically start HA Proxy server(load balancer) when even one of its backend web servers are up again

Implement monitoring service in HA Proxy load balancer which can automatically shut down haproxy server when all its backend web servers are down and automatically start HA Proxy server(load balancer) when even one of its backend web servers are up again.

Below is my HAProxy configuration file:

global
log 127.0.0.1:514 local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats timeout 30s
user haproxy
group haproxy
daemon

defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000

#frontend
#---------------------------------
frontend http_front
bind *:80
stats uri /haproxy?stats
default_backend http_back

#round robin balancing backend http
#-----------------------------------
backend http_back
balance roundrobin
mode http
server webserver1 10.10.31.171:8080 check # ip_address_of_2nd_centos_webserver (RLV4WB03)
server webserver2 10.10.31.172:8080 check # ip_address_of_1st_centos_webserver (RLV4WB04)

Duplicate: