This commit is contained in:
zeaslity
2024-10-30 16:30:51 +08:00
commit 437acbeb63
3363 changed files with 653948 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
#!/bin/bash
log_file=/etc/keepalived/report.log
COUNT=$(systemctl status nginx | grep -c "active (running)")
if [ "$COUNT" -eq 0 ];then
echo "[ERROR] moniter nginx failure ! $(date) " >> ${log_file}
systemctl restart nginx
sleep 2
if [ $(systemctl status nginx | grep -c "active (running)") -eq 0 ];then
echo "[ERROR] restart nginx failed ! $(date) " >> ${log_file}
killall keepalived
fi
fi