My blog has moved!

You should be automatically redirected in 6 seconds. If not, visit
http://www.mattdturner.com/wordpress
and update your bookmarks.

AdSense

Pages

Sunday, April 17, 2011

Cluster Status Check Script

Lets face it, nodes randomly go down without warning sometimes. If you’re like me, you aren’t going to consistently check the node status throughout the day. There have been cases where a node has gone down, and I didn’t know about it for a week.


This is very problematic, especially when you run a system that has a small number of nodes that are always in use.

In an effort to resolve both the problem of me not knowing there is a dead node without requiring me to check the node status multiple times a day, I developed a python script to check if there is a dead node. The script is set to run every day at midnight, and if there is a dead node it will send me an email.



Download the script here.


The only edits you should have to make in order to get the script to run on your system are lines 21 - 35.
  • Line 21: Change to match your username
  • Line 22: Change to match your email address.
  • Lines 25-35: Change to whatever email message you want sent.
Now all you have to do is add the script to cron.

And you’re done! 

0 comments:

Post a Comment