On 08/27/2013 02:16 PM, Nenad Merdanovic wrote:
> Hey Muhammad,
> 
> On 08/24/2013 01:51 PM, Muhammad Ammad Shah wrote:
>> Hi,
>>
>> is there any command line interface for haproxy to view failed or active 
>> servers.
>>
>> Thanks,
>> Muhammad Ammad Shah
> 
> www_test_foo,local_www,0,0,0,1,768,2,176,326,,0,,0,0,0,0,UP,100,1,0,0,1,3507,145,,1,4,1,,2,,2,0,,1,L4OK,,0,0,0,0,2,0,0,0,,,,0,0,,,,,
> www_test_bar,local_www,0,0,0,1,768,1,89,163,,0,,0,0,0,0,UP,100,1,0,0,1,3506,145,,1,5,1,,1,,2,0,,1,L4OK,,0,0,0,0,1,0,0,0,,,,0,0,,,,,
> testback,localredis-1,0,0,0,0,768,0,0,0,,0,,0,0,0,0,UP,100,1,0,0,0,3652,0,,1,6,1,,0,,2,0,,0,L4OK,,0,,,,,,,0,,,,0,0,,,,,
> testback,localredis-2,0,0,0,0,768,0,0,0,,0,,0,0,0,0,DOWN,100,0,1,0,1,3649,3649,,1,6,2,,0,,2,0,,0,INI,,,,,,,,,0,,,,0,0,,,,,
> testback_mysql,localmysql-1,0,0,0,0,768,0,0,0,,0,,0,0,0,0,DOWN,100,1,0,0,1,3648,3648,,1,7,1,,0,,2,0,,0,L4CON,,0,,,,,,,0,,,,0,0,,,,,
> 
> This is just an example using (e)grep and should be used just for
> demonstration. You should use awk or something to check if the specified
> field is 'DOWN'/'UP'/etc. and then do the logic based on that.
> 
> You can find more information about socket commands in section 9.2 of
> the HAproxy manual
> (http://haproxy.1wt.eu/download/1.5/doc/configuration.txt).
> 
> Regards,

Just noticed I didn't paste the command used to get that output:
echo "show stat -1 4 -1" | socat stdio unix-connect:/path/to/haproxy.sock

Also, socket is configurable using the 'stats socket' option which you
will find described in the same document.

Regards,
-- 
Nenad Merdanovic | PGP: 0x423edcb2 | Web: http://nimzo.info
Linkedin: http://www.linkedin.com/in/nenadmerdanovic

Reply via email to