Script to run Secondary node when Primary node failed

Hey,

I need a wrapper unix/python script to run the ground plex secondary(back-up) node when primary node fails.Thanks for any inputs on this.

Regards
Sudheer