通过sendmail和139邮箱监控服务器负载
#! /bin/bash
rmail="[email protected]"
L="25"
host=`hostname`
while :; do
load=`uptime |awk '{print $10}' |cut -d'.' -f 1`
if [ $load -gt $L ] ; then
uptime |awk '{print $8,$9,$10,$11,$12}'>/tmp/mail.txt
mail -s $host:`cat /tmp/mail.txt|awk '{print $3$4$5}'` $rmail </tmp/mail.txt
sleep 600
fi
sleep 3
done
none