本帖最后由 andy 于 2010-2-1 19:01 编辑
#! /bin/bash
rmail="15810682546@139.com"
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 /mail.txt
sleep 600
fi
sleep 3
done
#! /bin/bash
rmail="15810682546@139.com"
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 /mail.txt
sleep 600
fi
sleep 3
done
编辑回复