设置

设置

我已经设置了 PHP-FPM 插件

除三个图表外,所有图表均有效

  • PHP5-FPM 平均进程大小

  • PHP5-FPM 内存使用情况

  • PHP5-FPM 流程

设置

/etc/munin/plugin-conf.d/munin-node

[phpfpm_*]
env.url http://127.0.0.1/status
env.ports 80
env.phpbin php5-fpm
env.phppool www

命令行

apt-get install libwww-perl
cd /usr/share/munin/plugins
git clone git://github.com/tjstein/php5-fpm-munin-plugins.git
chmod +x php5-fpm-munin-plugins/phpfpm_*
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
/etc/init.d/munin-node restart

/var/ini/php/pools/www-php.conf

pm.status_path = /status

nginx.conf

server {
    listen  80;
    server_name  127.0.0.1;
    
    location ~ ^/(status|ping)$ {
        include  fastcgi_params;
        fastcgi_pass  php;
        fastcgi_param  SCRIPT_FILENAME  $fastcgi_script_name;
        allow  127.0.0.1;
        deny  all;
    }
}

测试

cd /etc/munin/plugins && munin-run phpfpm_status

相关内容