Jun
1

Tip: Script for Checking for Server Load

Author Rai    Category Linux     Tags , , , , ,

I wrote this simple bash script so I could tell the server’s current load by email. The script is run every 15 minutes and very lightweight.

#!/bin/bash

LOAD=`uptime | awk -F: ‘{print $5}’ | awk -F\, ‘{print $1}’`
RCPT=”kamotegirl@pinoytux.com”
TIMESTAMP=`date +%D\ %T\ %Z`

`uptime|mail -s “Server Load as of $TIMESTAMP is $LOAD” $RCPT`

Then setup the cronjob to execute the script to run every 15 minutes and send an email to the RCPT.


*/15 * * * * /home/bom/load_alert.sh > /dev/null

Related Posts

3 Comments to “Tip: Script for Checking for Server Load”

  • patrick June 1, 2008 at 7:33 pm

    Lemme try this script. thanks.

    patrick’s last blog post is Sex And The City The Movie

  • b_ng June 4, 2008 at 4:00 am

    wish i could say the same with patrick. but i really don’t know what to do with the script :) looks cool though :)

  • Body Combat DVD May 16, 2010 at 4:35 am

    What an outstanding work you have done. possess dished up lots of through creating this post. Caps away to a person. many thanks to a person and looking much more such as posts.

Post comment

CommentLuv Enabled

Powered by 1and1.comGlobat Webhosting Earn with Your BlogAdvertise @ PinoyTux

Search PinoyTux

Subscribe to Email Feeds

Enter Email Address:

Blog Lounge

Popular Posts

Recent Posts

Drop your Card Here

Recent Comments

Site Stats