High load alert

Developed In: bash — Contributed by: Shantanu Oak

Add the following one line command to crontab and run it every minute or every 5 minute. When the average server load is more than 40% send an alert to twitter account. Change the Username and Password.


Shantanu Oak
bash
  1. myvar=$(cat /proc/loadavg | awk '{print int($1)}'); [ $myvar -gt 40 ] && curl --basic --user username:password --data status="Average load on server $myvar" http://twitter.com/statuses/update.xml
  2.  

Current Tags

oksoft 

You must be logged in to tag this tool

No Comments yet

Votes

Not yet rated.
You must be logged in to vote.

Watches

0 members are watching this tool
You must be logged in to track this tool.

Provide Feedback

Please note:
HTML will be purified, but we allow for a number of HTML tags so that you have the flexibility to decorate your comment text to some extent. The comments allow the following HTML tags:

strong, b, em, blockquote, a, code, pre

To put code into your comment, simply encapsulate your code with
[code language="XXX"][/code], where XXX is any common language, for instance "PHP", "SQL", "C", etc.



You must be logged in to comment