代码拉取完成,页面将自动刷新
同步操作将从 mktime/python-learn 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
source /online/.bash_profile
echo "###################### 高拍仪主机关键进程监控 ##########################"
# 5,15,25,35,45,55 * * * * /online/shell/monitor.sh >> /online/shell/monitor.log
echo "检测日期:`date`"
echo "检测主机:`ifconfig bond0|grep "inet\>"|sed 's/^[ ]*//g'|awk '{print $2}'|sed 's/addr://g'`"
tom=`ps -ef|grep -v tail|grep -v vi|grep -v grep|grep tomcat|wc -l`
ng=`ps -ef|grep -v tail|grep -v vi|grep -v grep|grep nginx|wc -l`
rs=`ps -ef|grep -v tail|grep -v vi|grep -v grep|grep rsync|wc -l`
if [ $tom = "0" ];
then
echo "警告!tomcat进程不存在!"
while :;
do
echo "尝试启动tomcat..."
sh /online/tomcat/bin/startup.sh
tom=`ps -ef|grep -v tail|grep -v vi|grep -v grep|grep tomcat|wc -l`
if [ $tom = "0" ];
then
echo "启动失败!5秒后将再次尝试启动tomcat..."
sleep 5
continue
else
echo "tomcat启动成功!"
break
fi
done
else
echo "tomcat进程正常"
fi
if [ $ng = "0" ];
then
echo "警告!nginx进程不存在!"
while :;
do
echo "尝试启动nginx..."
/online/nginx/sbin/nginx
ng=`ps -ef|grep -v tail|grep -v vi|grep -v grep|grep nginx|wc -l`
if [ $ng = "0" ];
then
echo "启动失败!5秒后将再次尝试启动nginx..."
sleep 5
continue
else
echo "nginx启动成功!"
break
fi
done
else
echo "nginx进程正常"
fi
if [ $rs = "0" ];
then
echo "警告!rsync进程不存在!"
while :;
do
echo "尝试启动rsync..."
rm -f /online/rsync_server/rsyncd.pid
/bin/bash /online/rsync_server/start_rsync.sh &
sleep 1
rs=`ps -ef|grep -v tail|grep -v vi|grep -v grep|grep rs|wc -l`
if [ $rs = "0" ];
then
echo "启动失败!5秒后将再次尝试启动rsync..."
sleep 5
continue
else
echo "rsync启动成功!"
break
fi
done
else
echo "rsync进程正常"
fi
echo "###################### 高拍仪主机关键进程监控 ##########################"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。