Hi,
wondering if there is an option to setup an second, failover e-mail server for notifications.
Our current notifications go via SMTP (via our exchange server).
We recently are having problems with the connection between the Exchange server and Nagios (two completely different locations).
I would like to prevent such situations by using one of our spare servers, which is in a 3rd location and connected in an other way to the Nagios and exchange locations.
So when the primary exchange is unreachable, under normal circumstances it is possible to reach it via the backup smtp server.
How can I automate this?
As soon as the primary exchange is down, or unreachable or sending out notifications via smtp fails it would switch the server to the backup one.
Now I do it manually by changing the "host" field in the Admin -> Manage Email Settings to the backup server address.
E-mail failover
-
avandemore
- Posts: 1597
- Joined: Tue Sep 27, 2016 4:57 pm
Re: E-mail failover
Such a configuration isn't supported by Nagios, however I do have a few tips which may help.
First ensure Sendmail, not SMTP is selected as your default mailer. Nagios label are somewhat confusing here, Sendmail means send it off to a local MTA Sendmail or otherwise. SMTP means use PHP to connect to an SMTP server(it could even be localhost).
Now configure your local MTA to be a smart host/relay server. It's target should be your SMTP server. Normally you'll define this in DNS with a round robin between the two. Then if the first is unreachable, the second will pick up the load.
Or you can setup load balancing at the MTA level, example: http://serverfault.com/questions/427064 ... figuration
First ensure Sendmail, not SMTP is selected as your default mailer. Nagios label are somewhat confusing here, Sendmail means send it off to a local MTA Sendmail or otherwise. SMTP means use PHP to connect to an SMTP server(it could even be localhost).
Now configure your local MTA to be a smart host/relay server. It's target should be your SMTP server. Normally you'll define this in DNS with a round robin between the two. Then if the first is unreachable, the second will pick up the load.
Or you can setup load balancing at the MTA level, example: http://serverfault.com/questions/427064 ... figuration
Previous Nagios employee