开启php-fpm status
php-fpm.conf
pm.status_path = /statusx45
nginx.conf
location ~ /(statusx45)$
{
include fastcgi_params;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
}
http://127.0.0.1/statusx45 # 可带参数(json,xml,html) 加&full显示每个pool process
pool: www
process manager: static
start time: /Aug/::: +
start since:
accepted conn:
listen queue:
max listen queue:
listen queue len:
idle processes:
active processes:
total processes:
max active processes:
max children reached:
php-fpm status状态值详解
pool:fpm池子名称,大多数为www
process manager:进程管理方式,值:static,dynamic or ondemand
start time:启动日期,如果reload了php-fpm,时间会更新
start since:运行时长
accepted conn:当前池子接受的请求数
listen queue:请求等待队列,如果这个值不为0,那么要增加FPM的进程数量
max listen queue:请求等待队列最高的数量
listen queue len:socket等待队列长度
idle processes:空闲进程数量
active processes:活跃进程数量
total processes:总进程数量
max active processes:最大的活跃进程数量(FPM启动开始算)
max children reached:进程最大数量限制的次数,如果这个数量不为0,那说明你的最大进程数量太小了,需要设置大点
定义zabbix监控item key # 取状态值建议用xml格式
vim etc/zabbix_agentd.conf.d/userparameter_php-fpm.conf
UserParameter=php-fpm.status[*],/usr/bin/curl -s -m "http://127.0.0.1/statusx45?xml" | grep "<$1>" | awk -F'>|<' '{ print $$3}'
重启zabbix_agentd使监控key生效
客户端测试
服务器端 # 页面监控主机添加对应的application items
创建Graphs(php-fpm status)
zabbix后台 Configuration->Hosts->被监控的主机name->Graphs
查看graph(php-fpm status)
zabbix后台 Monitoring->Graphs->对应的graph