My configs:

In haproxy.cfg:

global
        log 127.0.0.1:514 local1 notice

In syslog.conf:

!!haproxy
local1.*                                                /var/log/haproxy.log
!*

In logpp.conf

root@haproxy01 $ cat /etc/logpp.conf


input var-log-haproxy {
         file /var/log/haproxy.log
       }

output send-mail {
        exec /usr/bin/mail -s "Alarm LB HAProxy" adm...@xxxxx.com
operat...@xxxx.com -f haproxy.moni...@xxxxx.com
       }

filter down-haproxy {
        regexp Server (.+)\/(.+) is DOWN
        template Server backend $2 Service frontend $1 state DOWN
       }

filter up-haproxy {
        regexp Server (.+)\/(.+) is UP
        template Server backend $2 Service frontend $1 state UP
       }

flow haproxy {
        input var-log-haproxy
        filter down-haproxy
        filter up-haproxy
        output send-mail
        }


2014-11-03 12:04 GMT-03:00 Andrey Zakabluk <a.zakab...@velcom.by>:

>  No (
>
> I have read manual  and I want see you config fali for example )
>
>
>
> For example, I have
>
>
>
>
>
>
>
>
>
> And I can not see in log haproxy informations about DOWN interface… or I
> not understand your idea?
>
>
>
>
>
> *From:* Jorge Severino [mailto:severino.jo...@gmail.com]
> *Sent:* Monday, November 3, 2014 3:51 PM
> *To:* Andrey Zakabluk
> *Subject:* RE: email alerts
>
>
>
> You a create config file?
>
> El 02-11-2014 8:55, "Andrey Zakabluk" <a.zakab...@velcom.by> escribió:
>
>  Hi! Maybe You can send me your config file for logpp ? For example. I
> want try use LogPP.
>
>
>
> I am created
>
>
>
> [root@srv-lb-prod2:/opt/install/logpp-0.16/src]# file logpp
>
> logpp: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically
> linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
>
> *From:* Jorge Severino [mailto:severino.jo...@gmail.com]
> *Sent:* Friday, October 24, 2014 3:29 PM
> *To:* Andrey Zakabluk
> *Cc:* HAProxy
> *Subject:* Re: email alerts
>
>
>
> I use logpp for read log and send email alert.
>
> El 24-10-2014 9:01, "Andrey Zakabluk" <a.zakab...@velcom.by> escribió:
>
> Hi!
> I use HA-Proxy version 1.5.6 2014/10/18/ . Red hat 6.
>
> I want use alert via mail. I find informations about this:
> -----------------------------------
> Patch HAProxy
> So this brings us on to option 3 patch HAProxy to send the alerts, after
> all how hard can it be?
> As I don’t really want to write my own SMTP client or use any other
> library’s lets go with the easy option of using mailx from the mailutils
> package as we know it works. The following was written for HAProxy dev18.
> Now I’m no developer so take the code more of a proof of concept instead of
> something to add to your production environment.
>
> Most of the work is already done for us, as HAProxy has functions for
> setting a server up or down and also has an array containing the server
> name, server’s status etc. So all we need to do is add our own function to
> send the email and parse the email address from the configuration file.
>
> This done in the following patch files:
> cfgparse.c
> checks.c
> log.c
> global.h
>
> So in the configuration file I have added the option “email_alert” to the
> global section with to and from address.
>
> http://blog.loadbalancer.org/3-ways-to-send-haproxy-health-check-email-alerts/
> -------------------------------------
>
> I try add text from patch file in the end original file and make haproxy
> file.
> /opt/haproxy/global.h.diff >> /opt/haproxy/include/types/global.h
>
> cat /opt/haproxy/cfgparse.diff >>/opt/haproxy/haproxy-1.5.6/src/cfgparse.c
>
> cat /opt/haproxy/log.diff >>/opt/haproxy/haproxy-1.5.6/src/log.c
>
> cat /opt/haproxy/checks.diff >>/opt/haproxy/haproxy-1.5.6/src/checks.c
>
>
> And while compiling I have error:
>
> [webadmin@srv-lb-qa haproxy-1.5.6_with_diff]$ make TARGET=linux2628
> CPU=generic
> gcc -Iinclude -Iebtree -Wall  -O2 -g -fno-strict-aliasing
>  -DCONFIG_HAP_LINUX_SPLICE -DTPROXY -DCONFIG_HAP_LINUX_TPROXY
> -DCONFIG_HAP_CRYPT -DENABLE_POLL -DENABLE_EPOLL -DUSE_CPU_AFFINITY
> -DASSUME_SPLICE_WORKS -DUSE_ACCEPT4 -DNETFILTER -DUSE_GETSOCKNAME
> -DCONFIG_HAPROXY_VERSION=\"1.5.6\" -DCONFIG_HAPROXY_DATE=\"2014/10/18\" \
>               -DBUILD_TARGET='"linux2628"' \
>               -DBUILD_ARCH='""' \
>               -DBUILD_CPU='"generic"' \
>               -DBUILD_CC='"gcc"' \
>               -DBUILD_CFLAGS='"-O2 -g -fno-strict-aliasing"' \
>               -DBUILD_OPTIONS='""' \
>                -c -o src/haproxy.o src/haproxy.c
> In file included from include/proto/proxy.h:28,
>                  from include/common/cfgparse.h:30,
>                  from src/haproxy.c:61:
> include/types/global.h:207: error: expected identifier or ‘(’ before ‘--’
> token
> include/types/global.h:209: error: stray ‘@’ in program
> include/types/global.h:209: error: stray ‘@’ in program
> include/types/global.h:209: error: stray ‘@’ in program
> include/types/global.h:209: error: stray ‘@’ in program
> include/types/global.h:213: error: expected identifier or ‘(’ before ‘+’
> token
> include/types/global.h:215: error: expected identifier or ‘(’ before ‘+’
> token
> include/types/global.h:216: error: expected identifier or ‘(’ before ‘+’
> token
> In file included from src/haproxy.c:76:
> include/types/global.h:207: error: expected identifier or ‘(’ before ‘--’
> token
> include/types/global.h:209: error: stray ‘@’ in program
> include/types/global.h:209: error: stray ‘@’ in program
> include/types/global.h:209: error: stray ‘@’ in program
> include/types/global.h:209: error: stray ‘@’ in program
> include/types/global.h:213: error: expected identifier or ‘(’ before ‘+’
> token
> include/types/global.h:215: error: expected identifier or ‘(’ before ‘+’
> token
> include/types/global.h:216: error: expected identifier or ‘(’ before ‘+’
> token
> In file included from include/proto/channel.h:35,
>                  from src/haproxy.c:85:
> include/types/global.h:207: error: expected identifier or ‘(’ before ‘--’
> token
> include/types/global.h:209: error: stray ‘@’ in program
> include/types/global.h:209: error: stray ‘@’ in program
> include/types/global.h:209: error: stray ‘@’ in program
> include/types/global.h:209: error: stray ‘@’ in program
> include/types/global.h:213: error: expected identifier or ‘(’ before ‘+’
> token
> include/types/global.h:215: error: expected identifier or ‘(’ before ‘+’
> token
> include/types/global.h:216: error: expected identifier or ‘(’ before ‘+’
> token
> make: *** [src/haproxy.o] Error 1
>
>
>
> Pls help me! I don't know how use patch(
>
>


-- 
Atte
Jorge Severino
Numero movil Personal: 08-7775834

Reply via email to