您的位置:首页 > 编程语言 > PHP开发

munin 配置php-fpm监控

2015-11-22 00:00 811 查看
摘要: munin 监控的插件配置

修改php-fpm配置

vim /data/local/webserver/php/etc/php-fpm.conf

把前面注释去掉
pm.status_path = /status

重启php
ps -aux | grep php
kill xxxx
/data/local/webserver/php/sbin/php-fpm -c /data/local/webserver/php/etc/php.ini

编辑nginx配置文件
vim /data/local/webserver/nginx/conf/nginx.conf

增加配置
location ~ ^/(status|ping)$
{
fastcgi_pass  unix:/tmp/php-cgi.sock;
include fastcgi.conf;
}

查看php-fpm status 监控是否成功 http://XX.XX.XX.XX/status 
进入插件目录
cd /usr/share/munin/plugins

下载munin php-fpm插件 https://github.com/tjstein/php5-fpm-munin-plugins 
增加执行权限
chmod +x php5-fpm-munin-plugins/phpfpm_*

#给插件软连到/etc/下
ln -s /usr/share/munin/plugins/php5-fpm-munin-plugins/phpfpm_average /etc/munin/plugins/phpfpm_average
ln -s /usr/share/munin/plugins/php5-fpm-munin-plugins/phpfpm_connections /etc/munin/plugins/phpfpm_connections
ln -s /usr/share/munin/plugins/php5-fpm-munin-plugins/phpfpm_memory /etc/munin/plugins/phpfpm_memory
ln -s /usr/share/munin/plugins/php5-fpm-munin-plugins/phpfpm_status /etc/munin/plugins/phpfpm_status
ln -s /usr/share/munin/plugins/php5-fpm-munin-plugins/phpfpm_processes /etc/munin/plugins/phpfpm_processes

重启munin
service munin-node restart

查看插件是否运行
munin-run phpfpm_memory
ram.value 277811200
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  munin php