Monitor Squid Run Script

  

#!/bin/shwhile sleep 30doSquidNum=`ps -ef| Grep squid| Grep -v grep| Wc -l`#HttpNum=`netstat -an| Grep 0.0.0.0:80| Grep -v grep| Wc -l` #80state if [ $SquidNum != 3 ] ; then /etc/rc3.d/squid start adddate=`date +%Y-%m-%d`" "`date +%H: %M:%S` echo "$adddate squid started!" >> /home/resquid.logfi# Restart squid service over 5,000 http requests HttpNum=`netstat -an| Grep 80| Grep -v grep| Wc -l`if [ $HttpNum -gt 5000 ] ; then /etc/rc3.d/squid restart adddate=`date +%Y-%m-%d`" "`date +%H:%M: %S` echo "$adddate http out 5000 squid started!" >> /home/resquid.logfidone
zh-CN"],null,[0.79029876],zh-CN"]]]

Copyright © Windows knowledge All Rights Reserved