CWP7解决nginx Connection failed in monit错误问题

解决CWP7 Monit监控错误问题:nginx Connection failed in monit

CWP7解决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

解锁 AI 助力,告别低效工作!🔓💼

🌟 立刻在频道置顶目录中,抢先体验这些神奇的AI神兵利器!🌟

喜欢就分享和按赞!您的分享和按赞,是我们持续的动力!

 

发表评论

您的邮箱地址不会被公开。 必填项已用 * 标注

滚动到顶部