Author Topic: Process - nginx Connection failed in monit  (Read 2904 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Process - nginx Connection failed in monit
« on: October 07, 2018, 12:53:36 PM »
Hi,
Can someone welp me?
When i go to monit monitoring i get an Connection failed on Nginx
How to solve this?

Thank you

Offline
*
Re: Process - nginx Connection failed in monit
« Reply #1 on: September 27, 2019, 10:57:00 PM »
try this
open your conf file /etc/monit.d/cwp.nginx

Before:
check process nginx with pidfile /run/nginx.pid
After:
check process nginx with pidfile /var/run/nginx.pid
then reload ALL it fixed my problem.

AT FIRST it was OK
but now i have same issue.

Any updates ?
« Last Edit: September 27, 2019, 11:30:48 PM by wipau »

Offline
*
Re: Process - nginx Connection failed in monit
« Reply #2 on: October 08, 2019, 09:11:06 AM »
Same problem here. I have changed PID file in the config file but no luck at all.

I also tried "/usr/local/cwpsrv/var/run/nginx.pid" but same error...
« Last Edit: October 08, 2019, 09:14:16 AM by carlosES »

Offline
*
Re: Process - nginx Connection failed in monit
« Reply #3 on: September 13, 2020, 11:41:07 AM »
Solve the problem of CWP7 Monit monitoring error: nginx Connection failed in monit

CWP7 solves the problem of nginx Connection failed in monit error

When Chen Weiliang installed the Monit monitoring software on the CWP control panel (CWP7) last time, he solved the problem that the Monit startup monitoring process disappeared. monit.service failed.

Now I encounter a new problem-Monit fails to monitor the Nginx connection...

How to solve nginx Connection failed in monit?
Methods to solve the problem of nginx Connection failed in monit error:

First, SSH enter the following command▼
Code: [Select]
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

Open the nginx configuration file :
Code: [Select]
/etc/nginx/nginx.conf
Found the path location of nginx.pid:
Code: [Select]
pid /var/run/nginx.pid;
In the configuration file of the Monit monitoring program, enter the following configuration for monitoring nginx▼
Code: [Select]
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 timeout

Restart Monit monitoring program▼
Code: [Select]
systemctl restart monit.service
View Monit monitoring program▼
Code: [Select]
systemctl status monit.service
If this step is reached, an 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▼
Code: [Select]
systemctl restart monit.service
View Monit monitor program status▼
Code: [Select]
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 to solve the problem of nginx Connection failed in monit error", it is helpful to you.

Welcome to share the link of this article: https://www.chenweiliang.com/cwl-1423.html
« Last Edit: September 13, 2020, 11:50:08 AM by bbsfww »
Chen Wei Liang Blog:
https://www.chenweiliang.com/

CWP (CENTOS WEB PANEL) control panel configuration method:
https://www.chenweiliang.com/cwp-kong-zhi-mian-ban/