Kev daws teeb meem CWP7 Monit kev saib xyuas yuam kev: nginx Kev sib txuas tsis ua tiav hauv kev saib xyuas

Zaum kawg, thaum Chen Weiliang tau nruab Monit monitoring software hauv CWP control panel (CWP7) , nws tau daws qhov teeb meem ntawm Monit monitoring process ploj thaum pib (monit.service failed).
Tam sim no kuv muaj qhov teeb meem tshiab - Saib xyuas kev sib txuas Nginx ua tsis tiav ...
Yuav daws li cas nginx Connection ua tsis tiav hauv monit?
Txoj kev los daws qhov nginx Kev Txuas tsis ua tiav hauv kev teeb tsa yuam kev:
Ua ntej, SSH rau hauv cov lus txib nram qab no ▼
ps -ef|grep nginxPom cov 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
Qhib cov ntaub ntawv teeb tsa nginx :
/etc/nginx/nginx.conf
Pom qhov chaw ntawm nginx.pid:
pid /var/run/nginx.pid;
Hauv cov ntaub ntawv teeb tsa ntawm Monit kev saib xyuas, nkag mus rau cov teeb tsa hauv qab no rau kev saib xyuas 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 timeoutRov pib Monit saib xyuas kev pab cuam ▼
systemctl restart monit.serviceSaib Monit saib xyuas qhov xwm txheej ▼
systemctl status monit.serviceYog tias cov kauj ruam no mus txog, cov lus yuam kev tseem tshwm sim:nginx Connection failed in monit
Thov sim hloov tus lej chaw nres nkoj ntawm kev saib xyuas nginx teeb tsa rau "8181" lossis "80":
if failed port 8181 protocol http then restart if failed port 80 protocol http then restart
Tom qab ntawd, rov pib Monit soj ntsuam kev pab cuam ▼
systemctl restart monit.serviceSaib Monit saib xyuas qhov xwm txheej ▼
systemctl status monit.serviceQhov teeb meem ntawm nginx Connection ua tsis tau tejyam nyob rau hauv monit thaum kawg daws!
Vam tias, tsab xov xwm "Kev daws qhov kev sib txuas nginx ua tsis tiav hauv qhov yuam kev monit" uas tau muab qhia rau ntawm Chen Weiliang lub blog ( https://www.chenweiliang.com/ ) yuav pab tau koj.
Xav qhia qhov txuas ntawm tsab xov xwm no: https://www.chenweiliang.com/cwl-1423.html
