检查load average 是否高并发送邮件

check load average for linux
 
#vi checkload.sh
#!/bin/sh
H=`ssh root@abc uptime |awk -F, '{print $3}'|cut -d: -f2`
echo $H
G=`echo $H |awk -F. '{print $1}'`
echo $G
F=`expr $G`
echo $F
if [ "$F" -gt 5 ] ; then
echo "load ave is high ,$F";
echo "$F" |mail -s "load ave is high" ab @hi.com.cn
else
echo "load ave is ok ,$F"
fi

你可能感兴趣的:(邮件,职场,load,休闲,average)