Zabbix monitoring PHP

Source: Internet
Author: User

Zabbix after installation, because the company is currently PHP environment, need to monitor, online check some information to record the process

Vim /usr/local/php/etc/php-fpm.conf adding pm.status_path = /phpfpmstatusvim /usr/local/nginx/ Conf/nginx.conf adding server {        listen        80;        server_name  localhost;         location ~ ^/(Phpfpmstatus) $ {              include fastcgi_params;              fastcgi_pass 127.0.0.1:9000;              fastcgi_param script_filename $ Fastcgi_script_name;        }}vim /usr/local/zabbix/etc/zabbix_ agentd.confunsafeuserparameters=1userparameter=phpfpm.status.pool,/usr/local/zabbix/etc/scripts/monitor_phpfpm _status pooluserparameter=phpfPm.status.process.manager,/usr/local/zabbix/etc/scripts/monitor_phpfpm_status process_ Manageruserparameter=phpfpm.status.start.since,/usr/local/zabbix/etc/scripts/monitor_phpfpm_status start_ sinceuserparameter=phpfpm.status.accepted.conn,/usr/local/zabbix/etc/scripts/monitor_phpfpm_status  Accepted_connuserparameter=phpfpm.status.listen.queue,/usr/local/zabbix/etc/scripts/monitor_phpfpm_status  listen_queueuserparameter=phpfpm.status.max.listen.queue,/usr/local/zabbix/etc/scripts/monitor_phpfpm_ Status max_listen_queueuserparameter=phpfpm.status.listen.queue.len,/usr/local/zabbix/etc/scripts/monitor _phpfpm_status listen_queue_lenuserparameter=phpfpm.status.idle.processes,/usr/local/zabbix/etc/scripts/ monitor_phpfpm_status idle_processesuserparameter=phpfpm.status.active.processes,/usr/local/zabbix/etc/ scripts/monitor_phpfpm_status active_processesuserparameter=phpfpm.status.total.processes,/usr/local/ Zabbix/etc/scripts/monitor_phpfpm_status totAl_processesuserparameter=phpfpm.status.max.active.processes,/usr/local/zabbix/etc/scripts/monitor_phpfpm_ Status max_active_processesuserparameter=phpfpm.status.max.children.reached,/usr/local/zabbix/etc/scripts /monitor_phpfpm_status max_children_reachedvim  /usr/local/zabbix/etc/scripts/monitor_phpfpm_ Status #!/bin/bashsource /etc/bashrc >/dev/null 2>&1source /etc/profile   >/dev/null 2>&1log_file=/tmp/phpfpmstatus.logcurl http://127.0.0.1/ Phpfpmstatus >${log_file}pool () {        awk  '/pool/  {print  $NF} '  ${log_file}}        process_manager ()  {                 awk  '/ process manager/ {print  $NF} '  ${log_file}}  start_since () {     awk  '/start since:/ {print  $NF} '  ${log_file}}accepted_conn () {    awk  '/accepted conn:/  {print  $NF} '  ${log_file}}listen_queue () {          awk  '/listen queue:/ {print  $NF} '  ${log_file}}max_listen_queue () {     awk  '/max listen queue:/ {print  $NF} '  ${log_file}}listen_queue_len () {       awk  '/listen queue len:/ {print  $NF} '  ${log_ File}}idle_processes () {    awk  '/idle processes:/ {print  $NF} '  ${ Log_file}}active_processes () {    awk  '/active processes:/ {print  $NF} '  ${log_file}}total_processes () {    awk  '/total processes:/ {print   $NF} '  ${log_file}}max_active_processes () {    awk  '/max active  processes:/ {print  $NF} '  ${log_file}}max_children_reached () {    awk  '/max children  reached:/ {print  $NF} '  ${LOG_FILE}}case  '  inpool ' pool;; Process_manager) Process_manager;; Start_since) start_since;; Accepted_conn) Accepted_conn;; Listen_queue) Listen_queue;; Max_listen_queue) Max_listen_queue;; Listen_queue_len) Listen_queue_len;; idle_processes) idle_processes;; active_processes) active_processes;; total_processes) total_processes;; max_active_processes) max_active_processes;; max_children_reached) max_children_reached;; *) echo  "Usage: $0 {pool|process_manager|start_since|accepted_conn|listen_queue|max_listen_queue |listen_queue_len|idle_processes|active_processes|total_processes|max_active_processes|max_children_reached} " Esacchmod 755 /usr/local/zabbix/etc/scripts/monitor_phpfpm_status last reboot nginx php-fpm  Then import the PHP-FPM module and associate it with the appropriate host

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/57/A5/wKiom1ShARmyYIBeAAKx-qCLqXg240.jpg "title=" Qqzabbix.jpg "alt=" Wkiom1sharmyyibeaakx-qclqxg240.jpg "/>

Reference Address Https://github.com/pengyao/zabbix/tree/master/PHP-FPM


Zabbix monitoring PHP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.