Addressing CWP7 Monit monitoringError problem: nginx Connection failed in monitor
Last timeChen WeiliangOnCWP Control Panel (CWP7) to install Monit monitoringsoftwareTime,Solved the Monit startup monitoring process disappearance monit.service failed.
Now I have a new problem - Monit monitoring Nginx connection failed...
How to solve nginx Connection failed in monit?
The method to solve the nginx Connection failed in monit error problem:
First, SSH into the following command ▼
ps -ef|grep nginx
Found the nginx configuration file:
[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
turn onnginx configuration file :
/etc/nginx/nginx.conf
Found the path location of nginx.pid:
pid /var/run/nginx.pid;
In the configuration file of the Monit monitoring program, enter the following configuration for monitoring 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
Restart the Monit monitoring program▼
systemctl restart monit.service
View Monit monitoring program status▼
systemctl status monit.service
If this step is reached, the error message still appears:nginx Connection failed in monit
Please try to modify the port number of the monitoring nginx configuration to "8181" or "80":
if failed port 8181 protocol http then restart if failed port 80 protocol http then restart
Then, restart the Monit monitoring program▼
systemctl restart monit.service
View Monit monitoring program status▼
systemctl status monit.service
The problem of nginx Connection failed in monit is finally solved!
Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) shared "CWP7 solves the problem of nginx Connection failed in monit error", which is helpful to you.
Welcome to share the link of this article:https://www.chenweiliang.com/cwl-1423.html
Welcome to the Telegram channel of Chen Weiliang's blog to get the latest updates!
📚 This guide contains huge value, 🌟This is a rare opportunity, don’t miss it! ⏰⌛💨
Share and like if you like!
Your sharing and likes are our continuous motivation!