个人检测php-fpm 运行状态

#!/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

上一篇:Excel文档保存时自动创建备份文档


下一篇:行为科学统计第一章知识点总结