استكشاف أخطاء مراقبة CWP7 Monit وإصلاحها: فشل اتصال nginx أثناء المراقبة

في المرة الأخيرة، عندما قام تشين ويليانغ بتثبيت برنامج مراقبة Monit في لوحة تحكم CWP (CWP7) ، قام بحل مشكلة اختفاء عملية مراقبة Monit عند بدء التشغيل (فشل خدمة monit).
لدي الآن مشكلة جديدة - فشل اتصال Nginx بمراقبة Monit ...
كيفية حل فشل اتصال nginx في المراقبة؟
طريقة حل فشل اتصال nginx في مشكلة خطأ المراقبة:
أولاً ، 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عرض حالة برنامج مراقبة مراقبة ▼
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عرض حالة برنامج مراقبة مراقبة ▼
systemctl status monit.serviceمشكلة اتصال nginx الفاشلة في المراقبة تم حلها أخيرًا!
نأمل أن تكون المقالة "حل مشكلة فشل اتصال nginx في monit" المنشورة على مدونة تشين ويليانغ ( https://www.chenweiliang.com/ ) مفيدة لك.
لا تتردد في مشاركة رابط هذه المقالة: https://www.chenweiliang.com/cwl-1423.html
