Ho rarolla mathata liphoso tsa ho shebella CWP7 Monitor : nginx Khokahano e hlolehile ho lekola

Lekhetlong la ho qetela, ha Chen Weiliang a kenya software ea ho beha leihlo ea Monit phanele ea taolo ea CWP (CWP7) , o ile a rarolla bothata ba ts'ebetso ea ho beha leihlo ea Monit e nyamelang ha e qala (monit.service e hlōlehile).
Joale ke na le bothata bo bocha - khokahano ea Monit monitoring ea Nginx e hlotsoe ...
Mokhoa oa ho rarolla nginx Connection e hlotsoe ho monit?
Mokhoa oa ho rarolla Nginx Connection o hlolehile bothateng ba phoso ea monit:
Taba ea pele, SSH ka taelo e latelang ▼
ps -ef|grep nginxFumana faele ea tlhophiso ea 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
Bula faele ea tlhophiso ea nginx :
/etc/nginx/nginx.conf
Fumana sebaka sa tsela ea nginx.pid:
pid /var/run/nginx.pid;
Ka faeleng ea tlhophiso ea lenaneo la ho beha leihlo la Monit, kenya tlhophiso e latelang bakeng sa ho beha leihlo 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 timeoutQala hape lenaneo la ho beha leihlo la Monit▼
systemctl restart monit.serviceSheba boemo ba lenaneo la ho beha leihlo la Monit▼
systemctl status monit.serviceHaeba mohato ona o fihlile, molaetsa oa phoso o ntse o hlaha:nginx Connection failed in monit
Ka kopo, leka ho fetola nomoro ea boema-kepe ea tlhophiso ea nginx ho "8181" kapa "80":
if failed port 8181 protocol http then restart if failed port 80 protocol http then restart
Ebe, qala hape lenaneo la ho beha leihlo la Monit▼
systemctl restart monit.serviceSheba boemo ba lenaneo la ho beha leihlo la Monit▼
systemctl status monit.serviceBothata ba nginx Connection bo hlotsoe ho monit bo rarollotsoe qetellong!
Re tšepa hore sengoloa se reng "Ho rarolla khokahano ea nginx ho hlolehile ka phoso ea monit" se arolelanoeng ho blog ea Chen Weiliang ( https://www.chenweiliang.com/ ) se tla u thusa.
Ikutloe u lokolohile ho arolelana sehokelo sa sengoloa sena: https://www.chenweiliang.com/cwl-1423.html
