您的位置:首页 > 运维架构 > Tomcat

脚本监测apache、tomcat服务

2011-07-04 15:30 387 查看
Apache

#!/bin/bash

# get the httpd pid

N=`ps -ef | grep httpd | wc -l`

if [ $N -le 2 ]

then

/etc/init.d/httpd start

else

echo

fi

Tomcat

#!/bin/bash

# get the tomcat pid

N=`ps -ef | grep tomcat | wc -l`

if [ $N -le 2 ]

then

/etc/init.d/tomcat start

else

echo

fi

可以把脚本写进crond,定时执行监测
本文出自 “no brothers,no linux” 博客,请务必保留此出处http://tonychiu.blog.51cto.com/656605/602494
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: