Re: Will HAProxy community supports mailers section?

2017-08-24 Thread Rajesh Kolli
Hi All,

Thanks for your support.

Earlier I have upgraded from 1.4 to 1.7 using source then haproxy working
but alerting is not working.

I have checked haproxy version using cli command and it has given 1.7.x but
if I query rpm then it's giving 1.4.x then I realized that upgrade has some
issue.

At least, I have download latest rpm RedHat and installed it then every
thing is working and alerts too working.

On 24 Aug 2017 7:57 pm, "Frederic Lecaille"  wrote:

> On 08/24/2017 03:35 PM, Rajesh Kolli wrote:
>
>> Hi Daniel,
>>
>> I have changed my config file according to you, even though i am getting
>> the same error.
>> -
>> haproxy.service - HAProxy Load Balancer
>>Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled)
>>Active: inactive (dead) since Thu 2017-08-24 19:04:14 IST; 6s ago
>>   Process: 7641 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f
>> /etc/haproxy/haproxy.cfg -p /run/haproxy.pid (code=exited,
>> status=0/SUCCESS)
>>  Main PID: 7641 (code=exited, status=0/SUCCESS)
>>
>> Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 systemd[1]: Starting HAProxy Load
>> Balancer...
>> Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 systemd[1]: Started HAProxy Load
>> Balancer.
>> Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[7641]:
>> [ALERT] 235/190414 (7642) : parsing [/etc/haproxy/haproxy.cfg:9]:
>> unknown keyword 'mailers' out of section.
>> Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[7641]:
>> [ALERT] 235/190414 (7642) : parsing [/etc/haproxy/haproxy.cfg:10]:
>> unknown keyword 'mailer' out of section.
>> Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[7641]:
>> [ALERT] 235/190414 (7642) : parsing [/etc/haproxy/haproxy.cfg:121] :
>> unknown keyword 'email-alert' in 'backend' section
>>
>
> Well I would at least say that your haproxy does not support "email-alert"
> keyword ;)
>
> If I configure a 1.7 haproxy *without* any "mailers" section *but* with a
> "email-alert mailers mta" setting in "backend" sections the parser does not
> say it does not known "email-alert" keyword. It says: unable to find
> "mailers" mta.
>
> So even your haproxy could support "mailers" keyword, as it does not
> support "email-alert", this would be for nothing ;)
>
> You should try the same thing: remove/comment your "mailers" section, and
> see if you still have "unknown keyword 'email-alert' in 'backend' section".
>
> AFAIK, "email-alert" may be followed by a "mailers" keyword  ;)
>
> Or perhaps I have missed something.
>


Re: Will HAProxy community supports mailers section?

2017-08-24 Thread Frederic Lecaille

On 08/24/2017 03:35 PM, Rajesh Kolli wrote:

Hi Daniel,

I have changed my config file according to you, even though i am getting
the same error.
-
haproxy.service - HAProxy Load Balancer
   Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled)
   Active: inactive (dead) since Thu 2017-08-24 19:04:14 IST; 6s ago
  Process: 7641 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f
/etc/haproxy/haproxy.cfg -p /run/haproxy.pid (code=exited, status=0/SUCCESS)
 Main PID: 7641 (code=exited, status=0/SUCCESS)

Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 systemd[1]: Starting HAProxy Load
Balancer...
Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 systemd[1]: Started HAProxy Load
Balancer.
Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[7641]:
[ALERT] 235/190414 (7642) : parsing [/etc/haproxy/haproxy.cfg:9]:
unknown keyword 'mailers' out of section.
Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[7641]:
[ALERT] 235/190414 (7642) : parsing [/etc/haproxy/haproxy.cfg:10]:
unknown keyword 'mailer' out of section.
Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[7641]:
[ALERT] 235/190414 (7642) : parsing [/etc/haproxy/haproxy.cfg:121] :
unknown keyword 'email-alert' in 'backend' section


Well I would at least say that your haproxy does not support 
"email-alert" keyword ;)


If I configure a 1.7 haproxy *without* any "mailers" section *but* with 
a "email-alert mailers mta" setting in "backend" sections the parser 
does not say it does not known "email-alert" keyword. It says: unable to 
find "mailers" mta.


So even your haproxy could support "mailers" keyword, as it does not 
support "email-alert", this would be for nothing ;)


You should try the same thing: remove/comment your "mailers" section, 
and see if you still have "unknown keyword 'email-alert' in 'backend' 
section".


AFAIK, "email-alert" may be followed by a "mailers" keyword  ;)

Or perhaps I have missed something.



Re: Will HAProxy community supports mailers section?

2017-08-24 Thread Rajesh Kolli
Hi,

I am using latest version.

[root@DS-11-82-R7-CLST-Node1 ~]# haproxy -v

HA-Proxy version 1.7.8 2017/07/07
Copyright 2000-2017 Willy Tarreau 



On Thu, Aug 24, 2017 at 6:59 PM, Jérôme Magnin  wrote:

> On Thu, Aug 24, 2017 at 06:50:51PM +0530, Rajesh Kolli wrote:
> > Hi Daniel,
> >
> > Thanks for your quick response...
> >
> > i am getting this error if i use mailers section in my configuration.
> > 
> -
> > [root@DS-11-82-R7-CLST-Node1 ~]# systemctl status haproxy.service -l
> > haproxy.service - HAProxy Load Balancer
> >Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled)
> >Active: inactive (dead) since Thu 2017-08-24 18:43:23 IST; 4s ago
> >   Process: 6511 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f
> > /etc/haproxy/haproxy.cfg -p /run/haproxy.pid (code=exited,
> status=0/SUCCESS)
> >  Main PID: 6511 (code=exited, status=0/SUCCESS)
> >
> > Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 systemd[1]: Starting HAProxy Load
> > Balancer...
> > Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 systemd[1]: Started HAProxy Load
> > Balancer.
> > Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> > [ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:81] :
> unknown
> > keyword 'mailers' in 'listen' section
> > Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> > [ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:82] :
> unknown
> > keyword 'mailer' in 'listen' section
> > Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> > [ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:117] :
> > unknown keyword 'email-alert' in 'backend' section
> > Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> > [ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:119] :
> > unknown keyword 'email-alert' in 'backend' section
> > Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> > [ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:120] :
> > unknown keyword 'email-alert' in 'backend' section
> > Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> > [ALERT] 235/184323 (6512) : Error(s) found in configuration file :
> > /etc/haproxy/haproxy.cfg
> > Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> > [ALERT] 235/184323 (6512) : Fatal errors found in configuration.
> > Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> > haproxy-systemd-wrapper: exit, haproxy RC=256
> >
>
> Hello Rajesh,
>
> you are most likely running a version in which mailers is not implemented
> (<1.6).
>
> Jérôme
>



-- 




*Thanks & RegardsRajesh Kolli*


Re: Will HAProxy community supports mailers section?

2017-08-24 Thread Rajesh Kolli
Hi Daniel,

I have changed my config file according to you, even though i am getting
the same error.
-
haproxy.service - HAProxy Load Balancer
   Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled)
   Active: inactive (dead) since Thu 2017-08-24 19:04:14 IST; 6s ago
  Process: 7641 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f
/etc/haproxy/haproxy.cfg -p /run/haproxy.pid (code=exited, status=0/SUCCESS)
 Main PID: 7641 (code=exited, status=0/SUCCESS)

Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 systemd[1]: Starting HAProxy Load
Balancer...
Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 systemd[1]: Started HAProxy Load
Balancer.
Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[7641]:
[ALERT] 235/190414 (7642) : parsing [/etc/haproxy/haproxy.cfg:9]: unknown
keyword 'mailers' out of section.
Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[7641]:
[ALERT] 235/190414 (7642) : parsing [/etc/haproxy/haproxy.cfg:10]: unknown
keyword 'mailer' out of section.
Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[7641]:
[ALERT] 235/190414 (7642) : parsing [/etc/haproxy/haproxy.cfg:121] :
unknown keyword 'email-alert' in 'backend' section
Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[7641]:
[ALERT] 235/190414 (7642) : parsing [/etc/haproxy/haproxy.cfg:123] :
unknown keyword 'email-alert' in 'backend' section
Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[7641]:
[ALERT] 235/190414 (7642) : parsing [/etc/haproxy/haproxy.cfg:124] :
unknown keyword 'email-alert' in 'backend' section
Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[7641]:
[ALERT] 235/190414 (7642) : Error(s) found in configuration file :
/etc/haproxy/haproxy.cfg
Aug 24 19:04:14 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[7641]:
[ALERT] 235/190414 (7642) : Fatal errors found in configuration.
Aug 24 19:04:15 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[7641]:
haproxy-systemd-wrapper: exit, haproxy RC=256


On Thu, Aug 24, 2017 at 6:57 PM, Daniel Heitepriem <
daniel.heitepr...@pribas.com> wrote:

> Hi Rajesh,
>
> as far as I know (but may be wrong) the "mailers" config has to be defined
> before any listen, frontend or backend directives. Also the "email-alert"
> has to be defined after the backend. So in your case it would look like
> this:
>
>
> #-
> # Global settings
> #-
> global
> log 127.0.0.1 local2
>
> chroot  /var/lib/haproxy
> pidfile /var/run/haproxy.pid
> maxconn 4000
> userhaproxy
> group   haproxy
> daemon
>
> stats socket /var/lib/haproxy/stats
>
> #-
> # common defaults that all the 'listen' and 'backend' sections will
> # use if not designated in their block
> #-
> defaults
> modehttp
> log global
> option  httplog
> option  dontlognull
> #option log-health-checks
> option http-server-close
> option forwardfor   except 127.0.0.0/8
> option  redispatch
> retries 3
> timeout http-request10s
> timeout queue   1m
> timeout connect 10s
> timeout client  1m
> timeout server  1m
> timeout http-keep-alive 10s
> timeout check   10s
> maxconn 3000
>
> mailers mta
>  mailer smtp1 127.0.0.1:25
>
> #-
> #HAProxy Monitoring Config
> #-
> listen haproxy3-monitoring
> bind :8080#Haproxy Monitoring run on port 8080
> mode http
> option forwardfor
> option httpclose
> stats enable
> stats show-legends
> stats refresh 5s
> stats uri /stats #URL for HAProxy
> monitoring
> stats realm Haproxy\ Statistics
> stats auth root:sangbe#User and Password for login to the
> monitoring dashboard
> stats admin if TRUE
> default_backend app#This is optionally for
> monitoring backend
>
> #-
> # main frontend which proxys to the backends
> #-
> frontend main
> bind :80
> option http-server-close
> option forwardfor
> default_backend app
>
>
> backend app
> balance roundrobin
> #option httpchk #HEAD / HTTP/1.1\r\nHost:\ localhost#Check the
> server application is up and healty - 200 status code
> server  11-80-R7-CLST-Node110.10.11.80:80 check
> server  

Re: Will HAProxy community supports mailers section?

2017-08-24 Thread Jérôme Magnin
On Thu, Aug 24, 2017 at 06:50:51PM +0530, Rajesh Kolli wrote:
> Hi Daniel,
> 
> Thanks for your quick response...
> 
> i am getting this error if i use mailers section in my configuration.
> -
> [root@DS-11-82-R7-CLST-Node1 ~]# systemctl status haproxy.service -l
> haproxy.service - HAProxy Load Balancer
>Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled)
>Active: inactive (dead) since Thu 2017-08-24 18:43:23 IST; 4s ago
>   Process: 6511 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f
> /etc/haproxy/haproxy.cfg -p /run/haproxy.pid (code=exited, status=0/SUCCESS)
>  Main PID: 6511 (code=exited, status=0/SUCCESS)
> 
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 systemd[1]: Starting HAProxy Load
> Balancer...
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 systemd[1]: Started HAProxy Load
> Balancer.
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> [ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:81] : unknown
> keyword 'mailers' in 'listen' section
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> [ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:82] : unknown
> keyword 'mailer' in 'listen' section
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> [ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:117] :
> unknown keyword 'email-alert' in 'backend' section
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> [ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:119] :
> unknown keyword 'email-alert' in 'backend' section
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> [ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:120] :
> unknown keyword 'email-alert' in 'backend' section
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> [ALERT] 235/184323 (6512) : Error(s) found in configuration file :
> /etc/haproxy/haproxy.cfg
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> [ALERT] 235/184323 (6512) : Fatal errors found in configuration.
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> haproxy-systemd-wrapper: exit, haproxy RC=256
>

Hello Rajesh,

you are most likely running a version in which mailers is not implemented
(<1.6).

Jérôme 



Re: Will HAProxy community supports mailers section?

2017-08-24 Thread Holger Just
Hi Rajesh,

Rajesh Kolli wrote:
> i am getting this error if i use mailers section in my configuration.

The ability to send mail alerts (and thus to configure this with a
mailers section) was added in HAProxy 1.6. If you use an older version,
this feature is not yet available to you.

Once you update to a newer version (e.g. the current version 1.7.8), the
feature should be usable for you.

Regards,
Holger



Re: Will HAProxy community supports mailers section?

2017-08-24 Thread Daniel Heitepriem
Hi Rajesh,

as far as I know (but may be wrong) the "mailers" config has to be
defined before any listen, frontend or backend directives. Also the
"email-alert" has to be defined after the backend. So in your case it
would look like this:

#-
# Global settings
#-
global
log 127.0.0.1 local2

chroot  /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
userhaproxy
group   haproxy
daemon

stats socket /var/lib/haproxy/stats

#-
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#-
defaults
modehttp
log global
option  httplog
option  dontlognull
#option log-health-checks
option http-server-close
option forwardfor   except 127.0.0.0/8 
option  redispatch
retries 3
timeout http-request10s
timeout queue   1m
timeout connect 10s
timeout client  1m
timeout server  1m
timeout http-keep-alive 10s
timeout check   10s
maxconn 3000

mailers mta
 mailer smtp1 127.0.0.1:25 

#-
#HAProxy Monitoring Config
#-
listen haproxy3-monitoring
bind :8080#Haproxy Monitoring run on port 8080
mode http
option forwardfor
option httpclose
stats enable
stats show-legends
stats refresh 5s
stats uri /stats #URL for HAProxy monitoring
stats realm Haproxy\ Statistics
stats auth root:sangbe#User and Password for login to
the monitoring dashboard
stats admin if TRUE
default_backend app#This is optionally for
monitoring backend

#-
# main frontend which proxys to the backends
#-
frontend main
bind :80
option http-server-close
option forwardfor
default_backend app


backend app
balance roundrobin
#option httpchk #HEAD / HTTP/1.1\r\nHost:\ localhost#Check the
server application is up and healty - 200 status code
server  11-80-R7-CLST-Node110.10.11.80:80
 check
server  DS-11-81-R7-CLST-Node210.10.11.81:80
 check

email-alert mailers mta
#email-alert level alert
email-alert from redm...@netrovert.net 
email-alert to rajesh.ko...@netrovert.net


Regards,
Daniel

Am 24.08.17 um 15:20 schrieb Rajesh Kolli:
> Hi Daniel,
>
> Thanks for your quick response...
>
> i am getting this error if i use mailers section in my configuration.
> -
> [root@DS-11-82-R7-CLST-Node1 ~]# systemctl status haproxy.service -l
> haproxy.service - HAProxy Load Balancer
>Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled)
>Active: inactive (dead) since Thu 2017-08-24 18:43:23 IST; 4s ago
>   Process: 6511 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f
> /etc/haproxy/haproxy.cfg -p /run/haproxy.pid (code=exited,
> status=0/SUCCESS)
>  Main PID: 6511 (code=exited, status=0/SUCCESS)
>
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 systemd[1]: Starting HAProxy
> Load Balancer...
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 systemd[1]: Started HAProxy
> Load Balancer.
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> [ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:81] :
> unknown keyword 'mailers' in 'listen' section
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> [ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:82] :
> unknown keyword 'mailer' in 'listen' section
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> [ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:117] :
> unknown keyword 'email-alert' in 'backend' section
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> [ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:119] :
> unknown keyword 'email-alert' in 'backend' section
> Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
> [ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:120] :
> unknown keyword 'email-alert' in 'backend' section
> Aug 24 18:43:23 

Re: Will HAProxy community supports mailers section?

2017-08-24 Thread Rajesh Kolli
Hi Daniel,

Thanks for your quick response...

i am getting this error if i use mailers section in my configuration.
-
[root@DS-11-82-R7-CLST-Node1 ~]# systemctl status haproxy.service -l
haproxy.service - HAProxy Load Balancer
   Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled)
   Active: inactive (dead) since Thu 2017-08-24 18:43:23 IST; 4s ago
  Process: 6511 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f
/etc/haproxy/haproxy.cfg -p /run/haproxy.pid (code=exited, status=0/SUCCESS)
 Main PID: 6511 (code=exited, status=0/SUCCESS)

Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 systemd[1]: Starting HAProxy Load
Balancer...
Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 systemd[1]: Started HAProxy Load
Balancer.
Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
[ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:81] : unknown
keyword 'mailers' in 'listen' section
Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
[ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:82] : unknown
keyword 'mailer' in 'listen' section
Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
[ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:117] :
unknown keyword 'email-alert' in 'backend' section
Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
[ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:119] :
unknown keyword 'email-alert' in 'backend' section
Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
[ALERT] 235/184323 (6512) : parsing [/etc/haproxy/haproxy.cfg:120] :
unknown keyword 'email-alert' in 'backend' section
Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
[ALERT] 235/184323 (6512) : Error(s) found in configuration file :
/etc/haproxy/haproxy.cfg
Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
[ALERT] 235/184323 (6512) : Fatal errors found in configuration.
Aug 24 18:43:23 DS-11-82-R7-CLST-Node1 haproxy-systemd-wrapper[6511]:
haproxy-systemd-wrapper: exit, haproxy RC=256


Here is my config file

[root@DS-11-82-R7-CLST-Node1 ~]# cat /etc/haproxy/haproxy.cfg
#-
# Global settings
#-
global
log 127.0.0.1 local2

chroot  /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
userhaproxy
group   haproxy
daemon

stats socket /var/lib/haproxy/stats

#-
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#-
defaults
modehttp
log global
option  httplog
option  dontlognull
#option log-health-checks
option http-server-close
option forwardfor   except 127.0.0.0/8
option  redispatch
retries 3
timeout http-request10s
timeout queue   1m
timeout connect 10s
timeout client  1m
timeout server  1m
timeout http-keep-alive 10s
timeout check   10s
maxconn 3000

#-
#HAProxy Monitoring Config
#-
listen haproxy3-monitoring
bind :8080#Haproxy Monitoring run on port 8080
mode http
option forwardfor
option httpclose
stats enable
stats show-legends
stats refresh 5s
stats uri /stats #URL for HAProxy monitoring
stats realm Haproxy\ Statistics
stats auth root:sangbe#User and Password for login to the
monitoring dashboard
stats admin if TRUE
default_backend app#This is optionally for
monitoring backend

mailers mta
 mailer smtp1 127.0.0.1:25

#-
# main frontend which proxys to the backends
#-
frontend main
bind :80
option http-server-close
option forwardfor
default_backend app


backend app
balance roundrobin
#option httpchk #HEAD / HTTP/1.1\r\nHost:\ localhost#Check the
server application is up and healty - 200 status code
email-alert mailers mta
#email-alert level alert
email-alert from redm...@netrovert.net
email-alert to rajesh.ko...@netrovert.net
server  11-80-R7-CLST-Node110.10.11.80:80 check
server  

Re: Will HAProxy community supports mailers section?

2017-08-24 Thread Daniel Heitepriem
Hi Rajesh,

the community version supports mailers. Here is a working section from
my configuration:

mailers mymailserver
mailer smtp1 10.1.0.251:25

frontend frontend_CHANGEME

bind *:443 ssl crt /opt/etc/haproxy/haproxy-t.pem force-tlsv12 no-sslv3

#
# backend configuration
#

backend booking-backend
compression algo gzip
compression type text/html text/plain text/css
server server1-t server1-t:8443 check ssl verify none maxconn 4000

backend vakanz-backend
compression algo gzip
compression type text/html text/plain text/css application/xml
server server2-t server2-t:8080 check verify none force-tlsv12 backup
server server3-t server3-t:8443 check ssl verify none no-sslv3

email-alert mailers mymailserver
email-alert from haprox...@mydomain.com
email-alert to myn...@mydomain.com

I hope it helps

Regards,
Daniel

Am 24.08.17 um 14:35 schrieb Rajesh Kolli:
> Hello,
>
> I am new to HAProxy, present i am using community version of haproxy,
> and i am trying to configure alerting in my configuration, after i
> configure "mailers" section and after restart of service it is
> throwing "unknown keyword mailers" in frontend.
>
> Now, my doubt is... will HAProxy community supports mailers/alerting?
>
> Thanks in advance if you suggest something on this.
>
> Thanks and Regards
>
> Rajesh Kolli
>
>