#/bin/bash
# edit: www.jbxue.com
#
SLEEPTIME=30
while true
do
id=`ps aux | grep httpd | grep -v "grep" | wc -l`
if [ $id -lt 1 ]; then
echo "---`date +"%F %H:%M:%S"`-----httpd restart." >> /u/scripts/httpd_monitor.log
/etc/init.d/httpd start
fi
sleep $SLEEPTIME
done
2016-11-16
对线上服务进行监控,如果死掉,就立即重启,以httpd进程为例:
评论
发表评论
姓 名: