#!/bin/bash
#check php-fpm server up/down
while :
do
sleep 15;
/usr/bin/curl https://api.xxx.com/public/status.php << ! > /alidata/server/fpm.log
quit
!
timestamp=`date '+%Y-%m-%d %H:%M:%S'`
content=$(cat /alidata/server/fpm.log)
if [ "$content" = "ok" ];then
echo -e "ok\n" ;
else
/etc/init.d/php-fpm restart
echo -e "$timestamp"" php-fpm restart\n" >> /alidata/server/restart.log;
fi
done
时间: 2024-10-04 08:55:01