I have haproxy setup locally and I am using a SMTP server to send email alerts which works fine. I setup the mailers section and then add the config to the backend which sends alerts when any of the 3 backend servers are down.
I moved the configuration to our aws vm and it does not work. I take a backend server down and no alerts are sent. checked the stats page and the health check fails which means haproxy sees it as down and an alert should be sent. I manually connected to the smtp server with telnet and sent an email and it works fine, this means port 25 is open and the vm CAN connect to the SMTP server.
I then installed tcpdump and monitored port 25 then took one of the backend servers down. NO data on port 25 which i think means haproxy is not even trying to connect. any ideas ?
Im using haproxy 1.8
thanks for any help.
Encrypted password support via crypt(3): yes
Built with zlib version : 1.2.7
Running on zlib version : 1.2.7
Compression algorithms supported : identity(“identity”), deflate(“deflate”), raw-deflate(“deflate”), gzip(“gzip”)
Built with OpenSSL version : OpenSSL 1.0.2k-fips 26 Jan 2017
Running on OpenSSL version : OpenSSL 1.0.2k-fips 26 Jan 2017
OpenSSL library supports TLS extensions : yes
OpenSSL library supports SNI : yes
OpenSSL library supports prefer-server-ciphers : yes
Built with PCRE version : 8.32 2012-11-30
Running on PCRE version : 8.32 2012-11-30
PCRE library supports JIT : no (USE_PCRE_JIT not set)
Built with Lua version : Lua 5.3.4
Built with transparent proxy support using: IP_TRANSPARENT IPV6_TRANSPARENT IP_FREEBIND
Available polling systems :
epoll : pref=300, test result OK
poll : pref=200, test result OK
select : pref=150, test result OK
Total: 3 (3 usable), will use epoll.
Available filters :
My local version is 1.5.
Mailer hostname is not dual stacked i believe. yes I can manually connect to the smtp server with telnet, and manually send an email, and yes I receive the email.
here is the haproxy.log after a fresh restart
Oct 25 13:03:27 localhost haproxy: Proxy api started.
Oct 25 13:03:27 localhost haproxy: Proxy test_backend started.
Oct 25 13:03:27 localhost haproxy: Proxy 429_slow_down started.
Oct 25 13:03:27 localhost haproxy: Proxy stats started.
Oct 25 13:03:27 localhost haproxy: Server test_backend/node1 is DOWN, reason: Layer4 connection problem, info: “Connection refused”, check duration: 0ms. 2 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Oct 25 13:03:28 localhost haproxy: Server test_backend/node3 is DOWN, reason: Layer4 connection problem, info: “Connection refused”, check duration: 0ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Oct 25 13:03:29 localhost haproxy: Connect from 127.0.0.1:39058 to 127.0.0.1:8080 (stats/HTTP)
so it sees those 2 backend servers are down but its not attempting reaching out to the SMTP server.
its not , hostname maps to 1 ip address.
I will install 1.7 and try that locally. seems to be some issue from AWS only. Do you know a way to test why haproxy would not try to connect to smtp server ? i think running tcpdump i should see it try to connect on port 25 but I dont. nothing shows.