检查系统内存
时间:2008-11-18 来源:w1_xiao
rm $TMPDIR/monmem > /dev/null 2>&1
/etc/swap -l | grep -v "swaplo" |awk '{
if ( $5*100/$4 < limit )
{
printf "页面文件使用率过高 %d\n",100-$5*100/$4 system("> $TMPDIR/monmem")
}
}' limit=$1 vmstat 1 1 | grep "1" |awk '{ if ($4 < limit)
{
printf "内存空页过低: %d\n",$4 system(">$TMPDIR/monmem")
}
}' limit=$2 if [ -f $TMPDIR/monmem ]
then
exit 40
else
echo "内存无异常"
exit 0
fi
{
printf "页面文件使用率过高 %d\n",100-$5*100/$4 system("> $TMPDIR/monmem")
}
}' limit=$1 vmstat 1 1 | grep "1" |awk '{ if ($4 < limit)
{
printf "内存空页过低: %d\n",$4 system(">$TMPDIR/monmem")
}
}' limit=$2 if [ -f $TMPDIR/monmem ]
then
exit 40
else
echo "内存无异常"
exit 0
fi
相关阅读 更多 +