监测kswapd0 进程
#! /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 [email protected] </tmp/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 [email protected] </tmp/mon_kswap.log
sleep 60
fi
sleep 5
done
none