On 29/06/2012 11:53, David Coulson wrote:
Is parsing out the http stats page (in csv, xml, or whatever) the
simplest way to get the current 'state' of HAProxy and the systems it is
routing to, or is there a better/cleaner/other way to do it?

Hi,

You can use the haprox stats socket to get the current 'state'.

echo "show stat" | socat unix-connect:/var/run/haproxy.sock stdio

The output is plain text that you can easily parse.

For a more complete description of how the unix socket is used in haproxy, go to the doc and look for "9.2. Unix Socket commands".
http://haproxy.1wt.eu/download/1.5/doc/configuration.txt

Regards,
Laurent

Reply via email to