Add a node to a cluster :
#!/bin/bash #in order to work the following line must be present in haproxy.cfg in main section #stats socket /var/lib/haproxy/stats mode 600 level admin BACK="BCK_PROD_WEB" FRONT=$1 echo "enable server $BACK/$FRONT" | socat stdio /var/lib/haproxy/stats echo "show stat" | socat stdio /var/lib/haproxy/stats |grep $FRONT
remove a node to a cluster :
#!/bin/bash #in order to work the following line must be present in haproxy.cfg in main section #stats socket /var/lib/haproxy/stats mode 600 level admin BACK="BCK_PROD_WEB" FRONT=$1 echo "disable server $BACK/$FRONT" | socat stdio /var/lib/haproxy/stats echo "show stat" | socat stdio /var/lib/haproxy/stats |grep $FRONT