孤独雪鹰 发表于 2018-12-31 08:14:14

监控nginx进程,切换keepalived

  #!/bin/bash
while:
do
nginxpid=`ps -C nginx --no-header | wc -l`
if [ $nginxpid -gt 0 ];then
   echo "Nginx is still alive"
else
   echo "Nginx is died"
   /etc/init.d/keepalived stop
fi
sleep 5
done



页: [1]
查看完整版本: 监控nginx进程,切换keepalived