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    from@x.y.z
        email-alert to      to@x.y.z
        email-alert cc      cc1@x.y.z, cc2@x.y.z
        email-alert bcc     bcc@x.y.z
        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.

Reply via email to