Zabbix Monitoring PHP-FPM Performance

Source: Internet
Author: User



First, you need to turn on the PHP-FPM state function


http://www.ttlsa.com/php/use-php-fpm-status-page-detail/

http://www.ttlsa.com/zabbix/zabbix-monitor-php-fpm-status/



Vim/usr/local/php/etc/php-fpm.conf


Pm.status_path =/status Remove Comment


Vim/etc/nginx/vhost/web.conf

Server

{

Listen 80;

server_name 192.168.80.62;

Index index.php index.html index.htm default.html default.htm default.php;

root/usr/local/nginx/html;

Location ~. *\. (PHP|PHP5)? $

{

Fastcgi_pass 127.0.0.1:9000;

Fastcgi_index index.php;

Include/etc/nginx/fastcgi_params;

}


Location ~ ^/(status|ping) $ #加上红色部分

{

Include Fastcgi_params;

Fastcgi_pass 127.0.0.1:9000;

Fastcgi_param script_filename $fastcgi _script_name;

}


Location/ngx_status {

Stub_status on;

Access_log off;

}


Location ~. *\. (gif|jpg|jpeg|png|bmp|swf) $

{

Expires 30d;

}

Location ~. *\. (JS|CSS)? $

{

Expires 12h;

}


Access_log off;

}

                     

Restart PHP-FPM


Pkill PHP-FPM

/usr/local/php/sbin/php-fpm


Test the following OK


[Email protected] ~]# Curl Http://127.0.0.1/status

Pool:www

Process Manager:dynamic

Start time:18/may/2016:07:04:35 +0800

Start since:715765

Accepted conn:21386

Listen queue:0

Max Listen queue:1

Listen Queue len:128

Idle Processes:5

Active processes:1

Total Processes:6

Max Active Processes:6

Max Children reached:0

Slow requests:0


Zabbix Client configuration key


Vim/usr/local/zabbix/etc/zabbix_agentd.conf

Userparameter=php-fpm.status[*],/usr/bin/curl-s "Http://127.0.0.1/status?xml" | grep "<$1>" | Awk-f ' >|< ' {print $$3} '


Killall Zabbix_agentd

/usr/local/zabbix/sbin/zabbix_agentd


Finally, you can import the template connection template in Zabbix-server


Template

Zabbix monitoring php-fpm Template-zabbix 3.x

Zabbix monitoring php-fpm Template-zabbix 2.x


This article from "No Trace" blog, declined reproduced!

Zabbix Monitoring PHP-FPM Performance

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.