#! /bin/bash
C=5
while :; do
c=`top -bn1 |awk '/kswapd0/ {print $9}'`
if [ "$c" -gt "$C" ] ; then
date >/tmp/mon_kswap.log
top -bn1 >>/tmp/mon_kswap.log
ps aux >>/tmp/mon_kswap.log
mail -s web-wowo lishiming2009@139.com /mon_kswap.log
sleep 60
fi
sleep 5
done
C=5
while :; do
c=`top -bn1 |awk '/kswapd0/ {print $9}'`
if [ "$c" -gt "$C" ] ; then
date >/tmp/mon_kswap.log
top -bn1 >>/tmp/mon_kswap.log
ps aux >>/tmp/mon_kswap.log
mail -s web-wowo lishiming2009@139.com /mon_kswap.log
sleep 60
fi
sleep 5
done
编辑回复