I think invoke an external command on alert would be better, just like what external-check do .
2014-06-24 8:15 GMT+08:00 Simon Horman <[email protected]>: > Hi Willy, > > Malcolm has asked me to open a discussion with you regarding adding > email alerts to haproxy and that is the purpose of this email. > > In essence the motivation is to provide a lightweight email alert > feature that may be used in situations where a full-blown monitoring > system is not in use. > > There is some discussion of this topic and several solutions, > including patches to haproxy, on the loadbalancer.org log. > > > http://blog.loadbalancer.org/3-ways-to-send-haproxy-health-check-email-alerts/ > > Would you be open to including such a feature in haproxy? > > If so I had it in mind to have haproxy send emails using the sendmail > command, > a variation of the mailx implementation at the link above, avoiding the > need to implement an SMTP client. > > I was thinking it could be configured using directives like the following, > borrowing ideas from my recent external-agent patch. > > global > email-alert > > listen ... > > option email-alert > email-alert command sendmail > email-alert path /usr/sbin:/usr/lib > email-alert from [email protected] > email-alert to [email protected] > email-alert cc [email protected], [email protected] > email-alert bcc [email protected] > email-alert subject Loadbalancer alert > email-alert custom-header X-Custom: foo > > It might be nice to allow the use of printf style directives in > the subject to allow it to include the name of the proxy and other > useful information. I expect that different users have different needs > there. > >

