Re: e-mail alert if backend down

From: Dawid Sieradzki / Gadu-Gadu <d.sieradzki#gadu-gadu.pl>
Date: Thu, 8 Jan 2009 14:55:06 +0100


>HI , HAProxy users.
>i use haproxy for loadbalance backend pool , only status page let i know
>which backend go down.
>anybody can help me to solve the way for haproxy alert when backend going
>down by e-mail.

You can try this:
1. Create backend for stats for example like that:

backend back_statystyki

        mode            http
        stats           uri /
        stats           refresh 5s

        balance roundrobin

2. write (for example perl) script witch will make connections every 1 min. (cron) to the http://lb-address/your_stats;csv You will get stats in csv format. Save "backend status" (it is time how long backend is UP) to file.

next campare status before and after, and send notifi via e-mail if there was reset.

-- 

Dawid Sieradzki
Infrastruktura, Administrator

Gadu-Gadu S.A.   http://www.gadu-gadu.pl
Al. Stanów Zjednoczonych 61   04-028 Warszawa
tel.: +48 22 5146499 wew 79   fax.: +48 22 5146498   gg:16200

Spółka zarejestrowana w Sądzie Rejonowym dla m. st. Warszawy, XIII
Wydział Gospodarczy KRS pod numerem 0000264575, NIP 867-19-48-977.
Kapitał zakładowy: 1 758 461,10 zł - wpłacony w całości. 
Received on 2009/01/08 14:55

This archive was generated by hypermail 2.2.0 : 2009/01/08 15:00 CET