Zabbix監控Nginx 和PHP-FPM狀態

來源:互聯網
上載者:User

標籤:nginx   zabbix   php-fpm   

Nginx內建監控模組ngx_http_stub_status_module提供Nginx的基本資料

在編譯安裝Nginx時加參數 --with-http_stub_status_module 

安裝好以後可以通過nginx -V|grep http_stub_status_module 查看狀態模組是否已安裝


PHP-FPM也內建監控,通過在php-fpm.conf中設定

pm.status_path = /php-fpm_status


就可以擷取URL的方式擷取PHP-FPM的狀態


  1. 添加nginx_status.conf

server {           listen       80 ;           location /nginx_status {                      stub_status on;            access_log off;            allow 127.0.0.1;#            allow 10.4.1.125;            deny all;                                  }                             location /php-fpm_status {             fastcgi_pass 127.0.0.1:9000;             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;             include fastcgi_params;                                     }         }
$ curl  127.0.0.1/nginx_statusActive connections: 1 server accepts handled requests 788163 788163 788163 Reading: 0 Writing: 1 Waiting: 0


Active connections   

          The current number of active client connections including Waiting connections.

          活躍用戶端串連數,包括處於等待狀態的串連數


accepts

          The total number of accepted client connections.

          接收到的用戶端串連總數


handled

        The total number of handled connections. Generally, the parameter value is the same as accepts unless some resource limits have been reached 

        處理請求的總數。通常情況下,這個值和accepts的值相同。除非達到了一些資源限制。例如設定worker_connections 1024;  設定一個worker進程能夠開啟的最大並發串連數。


      

requests

       The total number of client requests.

       用戶端請求總數


Reading

       The current number of connections where nginx is reading the request header.

       當前Nginx正在讀取要求標頭的串連數量

Writing

       The current number of connections where nginx is writing the response back to the client.

       當前Nginx正在將響應寫回到用戶端的串連數量

Waiting

       The current number of idle client connections waiting for a request.

       當前正在等待請求的閑置用戶端串連數量


$ curl  127.0.0.1/php-fpm_statuspool:                 wwwprocess manager:      dynamicstart time:           16/Nov/2014:13:29:11 +0800start since:          77844accepted conn:        202788listen queue:         0max listen queue:     1listen queue len:     128idle processes:       6active processes:     1total processes:      7max active processes: 4max children reached: 0slow requests:        0


pool                        pool名稱

process manager             static or dynamic

start time                  啟動時間

start since                 啟動了多長時間,以秒為單位

accepted conn               pool接收到的請求數量

idle processes              空閑進程數量

listen queue               the number of request in the queue of pending connections. If this number is non-zero, then you better increase number of process FPM can spawn.

                            


本文出自 “Linux SA John” 部落格,請務必保留此出處http://john88wang.blog.51cto.com/2165294/1577269

Zabbix監控Nginx 和PHP-FPM狀態

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.