频道栏目
首页 > 资讯 > Linux > 正文

linux系统下zabbix监控php-fpm要怎么配置?

18-06-14        来源:[db:作者]  
收藏   我要投稿

启用php-fpm status页面

[root@cat ~]# vim /etc/php-fpm.d/www.conf

pm.status_path = /php_status(将这一行注释去掉)

更改nginx配置文件

worker_processes 1;

events {

worker_connections 1024;

}

http {

include mime.types;

default_type application/octet-stream;

sendfile on;

keepalive_timeout 65;

server {

listen 80;

server_name localhost;

location /nginx_status {

stub_status;

access_log off;

allow 127.0.0.1;

allow 192.168.101.0/24; #(zabbix服务器的IP地址,一般是内网地址)

allow 10.0.0.0/24;

deny all;

}

location / {

root html;

index index.html index.htm;

}

location /php_status {

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

fastcgi_pass 127.0.0.1:9000;

}

location ~ \.php$ {

root html;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}

}

}

编译zabbix——agent配置文件

[root@cat ~]# vim /etc/zabbix/zabbix_agentd.d/php_status.conf

UserParameter=php-fpm.status[*],/usr/bin/curl -s "http://127.0.0.1/php_statusxml" | grep "<$1>" | awk -F'>|<' '{ print $$3}'

重启服务

[root@cat ~]# systemctl restart php-fpm.service

[root@cat ~]# systemctl restart nginx.service

[root@cat ~]# systemctl restart zabbix-agent.service

导入模板

相关TAG标签
上一篇:湖北“净网2018”行动重拳出击涉网犯罪 斩断黑客黑手
下一篇:linux系统iptables防火墙管理
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站