Welcome! Log In Create A New Profile

Advanced

programatically checking failed machines

Posted by Cord MacLeod 
Cord MacLeod
programatically checking failed machines
May 30, 2012 08:40PM
List,

I'm wondering, is there a hook or something of this nature I can call to find if/what are the down machines in my config file? Essentially the issue I'm attempting to solve is to automatically remove servers that haproxy believes are down. These machines are all SSL, so the ssl-hello-chk is the only way to tell if these machines are alive. Has anyone run into this?
Miah Johnson
Re: programatically checking failed machines
May 30, 2012 09:10PM
Cord,

Yes! You can use 'stats socket' or 'stats uri', and a small program that reads that to monitor your haproxy system. From there you can gather many statistics about your haproxy server, including but not limited to server status (up,down,etc), number of failed checks, and downtime.

--
Miah Johnson


On Wednesday, May 30, 2012 at 11:36 AM, Cord MacLeod wrote:

> List,
>
> I'm wondering, is there a hook or something of this nature I can call to find if/what are the down machines in my config file? Essentially the issue I'm attempting to solve is to automatically remove servers that haproxy believes are down. These machines are all SSL, so the ssl-hello-chk is the only way to tell if these machines are alive. Has anyone run into this?
Baptiste
Re: programatically checking failed machines
May 31, 2012 06:50AM
Hi,

You could also use stunnel in client mode and run your health checks over it :)

cheers

On Wed, May 30, 2012 at 9:03 PM, Miah Johnson <[email protected]> wrote:
> Cord,
>
> Yes! You can use 'stats socket' or 'stats uri', and a small program that
> reads that to monitor your haproxy system. From there you can gather many
> statistics about your haproxy server, including but not limited to server
> status (up,down,etc), number of failed checks, and downtime.
>
> --
> Miah Johnson
>
> On Wednesday, May 30, 2012 at 11:36 AM, Cord MacLeod wrote:
>
> List,
>
> I'm wondering, is there a hook or something of this nature I can call to
> find if/what are the down machines in my config file? Essentially the issue
> I'm attempting to solve is to automatically remove servers that haproxy
> believes are down. These machines are all SSL, so the ssl-hello-chk is the
> only way to tell if these machines are alive. Has anyone run into this?
>
>
Cord MacLeod
Re: programatically checking failed machines
June 04, 2012 10:20PM
Just got around to attempting this, it appears not to work with SSL. Is there any other option (stunnel breaks a lot and doesn't support 1 off connections)?

* Reloading haproxy haproxy [WARNING] 155/201028 (3442) : config : 'stats' statement ignored for proxy 'ssl-relay' as it requires HTTP mode.
[ OK ]



On May 30, 2012, at 12:03 PM, Miah Johnson wrote:

> Cord,
>
> Yes! You can use 'stats socket' or 'stats uri', and a small program that reads that to monitor your haproxy system. From there you can gather many statistics about your haproxy server, including but not limited to server status (up,down,etc), number of failed checks, and downtime.
>
> --
> Miah Johnson
>
> On Wednesday, May 30, 2012 at 11:36 AM, Cord MacLeod wrote:
>
>> List,
>>
>> I'm wondering, is there a hook or something of this nature I can call to find if/what are the down machines in my config file? Essentially the issue I'm attempting to solve is to automatically remove servers that haproxy believes are down. These machines are all SSL, so the ssl-hello-chk is the only way to tell if these machines are alive. Has anyone run into this?
>
Baptiste
Re: programatically checking failed machines
June 05, 2012 09:10AM
Could you at least provide your config?

cheers

On Mon, Jun 4, 2012 at 10:13 PM, Cord MacLeod <[email protected]> wrote:
> Just got around to attempting this, it appears not to work with SSL.  Is
> there any other option (stunnel breaks a lot and doesn't support 1 off
> connections)?
>
>  * Reloading haproxy haproxy
>                                              [WARNING] 155/201028 (3442) :
> config : 'stats' statement ignored for proxy 'ssl-relay' as it requires HTTP
> mode.
>
>                                        [ OK ]
>
>
>
> On May 30, 2012, at 12:03 PM, Miah Johnson wrote:
>
> Cord,
>
> Yes! You can use 'stats socket' or 'stats uri', and a small program that
> reads that to monitor your haproxy system. From there you can gather many
> statistics about your haproxy server, including but not limited to server
> status (up,down,etc), number of failed checks, and downtime.
>
> --
> Miah Johnson
>
> On Wednesday, May 30, 2012 at 11:36 AM, Cord MacLeod wrote:
>
> List,
>
> I'm wondering, is there a hook or something of this nature I can call to
> find if/what are the down machines in my config file? Essentially the issue
> I'm attempting to solve is to automatically remove servers that haproxy
> believes are down. These machines are all SSL, so the ssl-hello-chk is the
> only way to tell if these machines are alive. Has anyone run into this?
>
>
>
Willy Tarreau
Re: programatically checking failed machines
June 06, 2012 12:20AM
On Mon, Jun 04, 2012 at 01:13:31PM -0700, Cord MacLeod wrote:
> Just got around to attempting this, it appears not to work with SSL. Is there any other option (stunnel breaks a lot and doesn't support 1 off connections)?
>
> * Reloading haproxy haproxy [WARNING] 155/201028 (3442) : config : 'stats' statement ignored for proxy 'ssl-relay' as it requires HTTP mode.

That's expected since your SSL instance works in TCP mode. The "stats uri"
statement must be in an HTTP instance (use a dedicated port as most people
do, it looks like a waste at first but it's very convenient in the long run).

Also the "stats socket" in the global section allows you much more fun, as
you can connect there to get stats, change weights, start/stop servers,
kill server connections, etc...

Regards,
Willy
Sorry, only registered users may post in this forum.

Click here to login