I’m using haproxy 2.4.22 on Ubuntu Server 22.04 and I would like to have the server send an email alert when a backend server goes down.
Here is a portion of my /etc/haproxy/haproxy.cfg file :
mailer smtp1 10.100.50.125:587
mailer smtp2 10.100.50.126:587
When I shut down a backend server, I see this in the haproxy.log file :
haproxy: [WARNING] (7704) : Server rabbitCluster_web/web1 is DOWN, reason: Layer4 timeout, check duration: 2001ms
Despite that I do not receive any email from the server.
I have installed postfix and mailutils and used them to confirm that the server can send email though those SMTP servers with no authentication.
I don’t see any record of haproxy trying to send email at all.
I’ve also tried putting the email-alert config lines in the backend section but that doesn’t work either.
Any ideas what might be wrong or how I can further diagnose this?