rm $TMPDIR/moncpu > /dev/null 2>&1
sar 1 1 | grep -v "AIX" | grep -v "\%" | awk '/[0-9]/' | awk '{
if ( $5 < limit )
{
printf "系统CPU空闲低 U[%d] S[%d] W[%d] IDLE[%d]\n", $2,$3,$4,$5
system("> $TMPDIR/moncpu")
}
}' limit=$1
if [ -f $TMPDIR/moncpu ]
then
exit 10
else
echo "CPU正常"
exit 0
fi
阅读(1009) | 评论(0) | 转发(0) |