×ðÁú¿­Ê±¹ÙÍøµÇ¼

nginxÔõôÉó²éÔËÐÐ״̬

Éó²é nginx ÔËÐÐ״̬µÄÒªÁìÓУºÊ¹Óà ps ÏÂÁîÉó²éÀú³Ì״̬£»Éó²é nginx ÉèÖÃÎļþ /etc/nginx/nginx.conf£»Ê¹Óà nginx ״̬Ä £¿éÆôÓÃ״̬¶Ëµã£»Ê¹Óà prometheus¡¢zabbix »ò nagios µÈ¼à¿Ø¹¤¾ß¡£

ÔõÑùÉó²é Nginx ÔËÐÐ״̬

Éó²éÀú³Ì״̬

×î¼òÆÓµÄÒªÁìÊÇʹÓà ps ÏÂÁîÉó²é Nginx Àú³ÌµÄÔËÐÐ״̬£º

ps aux | grep nginx

µÇ¼ºó¸´ÖÆ

´ËÏÂÁÁгöËùÓÐÕýÔÚÔËÐеÄÀú³Ì£¬°üÀ¨ Nginx Àú³Ì¡£Êä³öЧ¹û½«ÏÔʾ Nginx Àú³ÌµÄÀú³Ì ID (PID)¡¢CPU ºÍÄÚ´æʹÓÃÇéÐεÈÐÅÏ¢¡£

Éó²éÉèÖÃÎļþ

Nginx µÄÉèÖÃÎļþͨ³£Î»ÓÚ /etc/nginx/nginx.conf¡£Äú¿ÉÒÔʹÓÃÎı¾±à¼­Æ÷£¨Èç vim »ò nano£©·­¿ª´ËÎļþ²¢Éó²éÉèÖÃÐÅÏ¢¡£

ÔÚÉèÖÃÎļþÖУ¬Äú¿ÉÒÔÕÒµ½ÓÐ¹Ø Nginx ¼àÌý¶Ë¿Ú¡¢ÐéÄâÖ÷»úºÍ¹ýʧÈÕÖ¾µÈÐÅÏ¢¡£

ʹÓà Nginx ״̬Ä £¿é

Nginx ״̬Ä £¿éÔÊÐíÄúͨ¹ý HTTP ¶ËµãÉó²éЧÀÍÆ÷״̬¡£ÒªÆôÓôËÄ £¿é£¬ÇëÔÚ Nginx ÉèÖÃÎļþÖÐÌí¼ÓÒÔÏÂÐУº

load_module modules/ngx_status_module.so;

µÇ¼ºó¸´ÖÆ

²¢Ìí¼ÓÒ»¸öÐ嵀 Nginx ЧÀÍÆ÷¿éÒÔ¹ûÕæ״̬¶Ëµã£º

location /nginx-status {
    stub_status   on;
    access_log    off;
}

µÇ¼ºó¸´ÖÆ

È»ºó£¬Äú¿ÉÒÔͨ¹ýä¯ÀÀ´Ë¶ËµãÀ´Éó²é Nginx ЧÀÍÆ÷µÄ״̬ÐÅÏ¢£º

http://<nginx_server_address>/nginx-status</nginx_server_address>

µÇ¼ºó¸´ÖÆ

ʹÓüà¿Ø¹¤¾ß

ÉÐÓÐһЩ¼à¿Ø¹¤¾ß¿ÉÒÔ×ÊÖúÄúÉó²é Nginx µÄÔËÐÐ״̬£¬ÀýÈ磺

Prometheus

Zabbix

Nagios

ÕâЩ¹¤¾ß¿ÉÒÔ°´ÆÚÍøÂçºÍÏÔʾ Nginx µÄÖ¸±ê£¬ÀýÈçÇëÇóÂÊ¡¢ÏìӦʱ¼äºÍÄÚ´æÕ¼ÓÃÇéÐΡ£

ÒÔÉϾÍÊÇnginxÔõôÉó²éÔËÐÐ״̬µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ