script to only run if it cant ping a host
Ive got a server that runs a runs a script on the hour. Trouble is said server is a bit prone to the occasional lockup or crash etc and sometimes the script wont run untill I can get someone to reboot the server..
Got a backup server that runs, that isnt really capable of running the script regularly but could cope with it for a couple of days.. I was wondernig if there was a wayh of running a script on the backup server to do the following
Check main server is replying to ping
if OK do nothing
if no ping, run the script locally
Both machines are gentoo linux so a perl / bash / python or whatever would be fine to run
Any ideas would be appreciated.. cheers..