shell监控php是否挂了502 ,并重启php

版权声明:廖圣平博客,未经博主允许不得转载。企鹅:1194008361 https://blog.csdn.net/qq_22823581/article/details/86214418
    #!/bin/bash
    
    CheckURL="http://xx"
    
    STATUS_CODE=`curl -o /dev/null -m 10 –connect-timeout 10 -s -w %{http_code} $CheckURL`
    
    #echo "$CheckURL Status Code:\t$STATUS_CODE"
    
    if [ "$STATUS_CODE" = "502" ]; then

    lnmp php-fpm restart

	fi

保存:

502.sh

* * * * * sh /www/sh/502.sh >> /www/log/crontab.log 2>1

原文:https://www.1bug.com/?p=1405

没有更多推荐了,返回首页