script to notify high server load | linux script for monitoring server

 

Hi,

 

The following is the script which will send mail to admin if the server’s load is more than 15, please enable cron to execute it frequently.

 

 

#!/bin/bash
SUBJECT="`hostname`server load is high"
TO=admin@yourdomain.com
uptime > /tmp/load
if [ `uptime | awk '{ print$11 }' | cut -d. -f1` -gt 15 ];
then
mail -s "$SUBJECT" $TO < /tmp/load
exit
fi

 

Thank you for viewing helpinlinux.com

Leave a Reply

Protected by WP Anti Spam