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?
Failover SMTP server
Re: Failover SMTP server
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.
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
Re: Failover SMTP server
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
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
https://outsideit.net
Re: Failover SMTP server
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.
"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.
Re: Failover SMTP server
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
Re: Failover SMTP server
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.
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.
Re: Failover SMTP server
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?
Do either of these appeal to you?
Former Nagios employee
Re: Failover SMTP server
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.
I appreciate you accepting this input.
Re: Failover SMTP server
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.
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.
"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.