Failover SMTP server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
belvdr
Posts: 81
Joined: Tue Oct 08, 2013 9:17 pm

Failover SMTP server

Post by belvdr »

I have two separate standalone SMTP servers in two different locations.

During maintenance or downtime of the primary SMTP server, I'd like Nagios to use the secondary SMTP server.

Does Nagios support a secondary SMTP server setting? If not, does anyone have a script they use to test SMTP server connectivity first before sending a notification?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Failover SMTP server

Post by tmcdonald »

Nagios does not support a secondary SMTP server at this time.

I found one related post but nothing the discusses detecting the SMTP availability first:

http://support.nagios.com/forum/viewtop ... 14&p=15425

It can certainly be done, but it would slow down every notification since you now have to check even if the server is in a known good state.
Former Nagios employee
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Failover SMTP server

Post by WillemDH »

Or use some sort of load balancer like F5 or something if you are lucky to have one.

We have one and it is working fine. Email is sent to smtp alias pointing to F5 load balancer which will direct traffic to any alive smtp server.

Cheers

Willem
Nagios XI 5.8.1
https://outsideit.net
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Failover SMTP server

Post by abrist »

Load balancer or virtual ip are the solutions I have seen used the most.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Failover SMTP server

Post by tmcdonald »

In a pinch you could do it with DNS, but the propagation time might be an issue and you would need to change this at the DNS level anyway, so may as well do it in XI.
Former Nagios employee
belvdr
Posts: 81
Joined: Tue Oct 08, 2013 9:17 pm

Re: Failover SMTP server

Post by belvdr »

Thanks for the thoughts.

I'm looking into using pacemaker to deploy a postfix cluster, but that's taking some time to design. I was hoping for a simpler solution, but it seems it doesn't exist.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Failover SMTP server

Post by tmcdonald »

We can always enter in a feature request, since this seems like a pretty reasonable thing to need. Or if you need it now, custom development is always an option.

Do either of these appeal to you?
Former Nagios employee
belvdr
Posts: 81
Joined: Tue Oct 08, 2013 9:17 pm

Re: Failover SMTP server

Post by belvdr »

Feature request is fine. I believe a simple check to see if the email is sent would be enough. For example, if Nagios attempts to send an email through smtp1 and it fails or the connection isn't accepted, then it would rotate to the next SMTP server, and so forth.

I appreciate you accepting this input.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Failover SMTP server

Post by abrist »

Log your feature request at: tracker.nagios.com
The has not really been requested as most people control this with dns or virtual ips/clustering.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked