解決CWP7 Monit監控錯誤問題:nginx Connection failed in monit
上次陳溈亮在CWP控制面板(CWP7)安裝Monit監控軟件時,解決了Monit啟動監控進程消失monit.service failed.
現在又遇到新問題——Monit監控Nginx連接失敗……
如何解決nginx Connection failed in monit?
解決nginx Connection failed in monit錯誤問題的方法:
首先,SSH輸入以下命令▼
ps -ef|grep nginx
找到了nginx的設定檔:
[root@ten ~]# ps -ef|grep nginx root 11550 1 0 02:12 ? 00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf nobody 11551 11550 0 02:12 ? 00:00:04 nginx: worker process nobody 11552 11550 0 02:12 ? 00:00:08 nginx: worker process nobody 11553 11550 0 02:12 ? 00:00:02 nginx: worker process nobody 11554 11550 0 02:12 ? 00:00:01 nginx: worker process nobody 11555 11550 0 02:12 ? 00:00:00 nginx: cache manager process root 19827 9820 0 02:37 pts/0 00:00:00 grep --color=auto nginx
打開nginx的設定檔:
/etc/nginx/nginx.conf
找到了nginx.pid的路徑位置:
pid /var/run/nginx.pid;
在Monit監控程序的配置文件裡,輸入以下監控nginx的配置▼
check process nginx with pidfile /var/run/nginx.pid
start program "/usr/bin/systemctl start nginx.service"
stop program "/usr/bin/systemctl stop nginx.service"
if failed port 8181 protocol http then restart
if 4 restarts within 8 cycles then timeoutif 4 restarts within 8 cycles then timeout
重啟Monit監控程序▼
systemctl restart monit.service
查看Monit監控程序狀態▼
systemctl status monit.service
若到此步驟,還是出現錯誤提示:nginx Connection failed in monit
請嘗試修改監控nginx配置的端口號為“8181”或“80”:
if failed port 8181 protocol http then restart if failed port 80 protocol http then restart
然後,重啟Monit監控程序▼
systemctl restart monit.service
查看Monit監控程序狀態▼
systemctl status monit.service
nginx Connection failed in monit的問題,終於解決了!
希望陳溈亮博客( https://www.chenweiliang.com/ ) 分享的《CWP7解決nginx Connection failed in monit錯誤問題》,對您有幫助。
歡迎分享本文鏈接:https://www.chenweiliang.com/cwl-1423.html
歡迎加入陳溈亮博客的Telegram 頻道,獲取最新更新!
🔔 率先在頻道置頂目錄獲取寶貴的《ChatGPT 內容行銷AI 工具使用指南》! 🌟
📚 這份指南蘊含價值巨大,🌟難逢的機遇,切勿錯失良機! ⏰⌛💨
喜歡就分享和按贊!
您的分享和按贊,是我們持續的動力!
📚 這份指南蘊含價值巨大,🌟難逢的機遇,切勿錯失良機! ⏰⌛💨
喜歡就分享和按贊!
您的分享和按贊,是我們持續的動力!