Forum Discussion

David_Noonan_67's avatar
David_Noonan_67
Icon for Nimbostratus rankNimbostratus
Apr 17, 2009

execute script on server

I've got an application that wants to use the BigIP for failover. They'll have two servers in the pool but they want the service on the backup to be turned off until the primary fails.

 

 

The question: If a monitor fails can I make an iRule execute a script on the backup server to start it's service?

 

 

The more I think about this the more broken I think the whole plan is but I'll leave the question anyway as the info might prove useful in the future.

 

Thanks

 

--

 

Dave

3 Replies

  • Dave: Barring some back-end nuances that prevent it, the way to do this is to use priority groups with the appropriate priority scores. This way you can keep both active and you won't have to worry about traffic going to the 'primary' pool member vs. the 'secondary'. BigIP will just do the right thing. If the primary fails, then the secondary will kick in...

     

     

    The only caveat here is that in some (rare) cases the systems involved can't both be up and running at the same time. In this situation I would actually suggest iControl calls from the backend systems to register themselves as pool candidates. See the register_self iControl script for one idea on how this could be done: http://devcentral.f5.com/wiki/default.aspx/iControl/pyControl_RegisterSelf.html.

     

     

    To answer your specific question, iRules can't really call to remote systems in the way you're thinking, although if you *really* wanted to do this you could probably figure something out. This would be a very last resort though, as you've got a great mechanism built right in - priority groups.

     

     

    -Matt
  • Hi Dave,

     

     

    Matt's suggestion for using priority groups is a good one. I recently found out from another poster that you can also run a command when a specific string is sent to alertd:

     

     

    Generic command in user_alert.conf

     

    http://devcentral.f5.com/Default.aspx?tabid=53&forumid=32&tpage=1&view=topic&postid=55956 (Click here)

     

     

    Aaron
  • I'm aware of priority groups and planned to use them for part of this solution. Starting the app service is the tricky bit.

     

     

    I think what's going on here is that the service is processing files on a shared file system and if the service is running on the backup service it will process those files at the same time that the primary system does resulting in either duplication or in the primary missing things because the backup grabbed the file. This seems like something the application should be able to deal with so I'm going to pursue it further with them.

     

     

    Thanks for your help.

     

    --

     

    Dave