闲者博客 - 监测
https://bk1314.com/tag/%E7%9B%91%E6%B5%8B/
-
宝塔定时任务监测502就重启
https://bk1314.com/16.html
2022-02-23T17:23:00+08:00
下面代码复制在宝塔定时任务 设置shell命令 建议5分钟监测一次 56是php版本哦PHP7.2就是72#!/bin/bash
if [[ `curl -sS --connect-timeout 15 -m 15 127.0.0.1/phpfpm_56_status|grep 502` == *"502"* ]]; then
/etc/init.d/php-fpm-56 stop
/etc/init.d/php-fpm-56 start
else
echo php56 normal.
fi