用nc做简单web服务器监控机器状态
#!/bin/bash
top -b -n 1 >topinfo.txt
prog="nc -l 9944"
count=1;
echo "beging"
while [ count>0 ]
do
pnum=`ps -wef|grep "${prog}" |grep -v grep |grep " 1 "|wc -l`
echo $pnum
if test $pnum -lt 1
then
top -b -n 1 >topinfo.txt
nc -l 9944 fi
done
你可以用firfox浏览器查看了.如
阅读(2711) | 评论(0) | 转发(0) |