linux監控,單行指令碼

wangzhensheng發表於2007-10-11

while (:); do p=`ps -ef | grep httpd | grep -v grep | wc -l`; echo "p=$p" ;n=`netstat -anlp | grep 'xxx.xxx.xxx.xxx:80' | wc -l`; echo "n=$n";echo "";sleep 2 ;done

while : ; do ps -ef H| grep -v grep | grep httpd | wc -l ;sleep 2;echo "" ;done

free | grep buffers | tail +2 | awk '{print $4}'

=======================================

pnum=0;if [ "$pnum" -eq "0" ]; then echo "ok" ; else echo "no ok ..." ;fi

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8806316/viewspace-975802/,如需轉載,請註明出處,否則將追究法律責任。

相關文章