Service failover dependency

Andrey Mitroshin mit at akamit.com
Thu Apr 7 11:45:28 CEST 2011


I'm afraid I did not explained my problem clearly.

So, I've got 2 servers. 
serverA - primary (10.0.0.1)
serverB - backup (10.1.0.1)

There is some apache vhost named www.site.com configured on both of them. 
My failover is supposed to work as follows.

Usually serverA is up and www.site.com resolves to 10.0.0.1.
when serverA.com goes down, nagios executes evenhandler, updates A
record  and www.site.com points to 10.1.0.1 (serverB).

The problem arises when both servers are down. So, evenhandler updates
A record of www.sites.com, but serverB is down as well

My goal is to avoid executing eventhandler when serverB is down.
And the question is how to configure such a behaviour in nagios.

On Thu, Apr 07, 2011 at 09:26:18AM +0000, Assaf Flatto wrote:
> Andrey Mitroshin wrote:
> > Hello,                                                                                                                                                       
> > I'm about to implement simple failover scenario with nagios. It consists of
> > host A, host B and nagios host. When host A is down nagios executes
> > event handler which performs dynamic dns update on some hostname to
> > point it to host B. But when host B is down, nagios should not execute
> > event handler as there is nothing to switch to. How can I configure 
> > nagios not to execute event hanlder when some service check or host
> > check has failed?
> > Thanks in advance.
> > --
> >  mit.
> >
> >   
> When you configure the service , you define event handlers , you can 
> create a service definition for each host and service , so you can 
> exclude any host or service from running the event handler .
> 
> example :
> define service {
>           hostgroups WEB
>           host_name !web1 , !web2
>           ...
>           eventhandler   change_dns
> }
> 
> 
> this will cause the service and event handler to work on all hosts in 
> the WEB hostgroup excluding the web1 and web2 servers.
> 
> hope this helps .
> 
> Assaf
> 
> ------------------------------------------------------------------------------
> Xperia(TM) PLAY
> It's a major breakthrough. An authentic gaming
> smartphone on the nation's most reliable network.
> And it wants your games.
> http://p.sf.net/sfu/verizon-sfdev
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null


------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list