zabbix 监控php-fpm
2016-06-02 12:00
483 查看
zabbix监控php-fpm主要是通过nginx配置php-fpm的状态输出页面,在正则取值
要nginx能输出php-fpm的状态必须要先修改php-fpm的配置,这个配置没有开启nginx 就没有办法输出php-fpm status
修改/usr/local/php/etc/php-fpm.conf 文件
注意:不是php.ini,如果没有配置添加配置
打开/usr/local/nginx/conf/nginx.conflocation /status {
allow 127.0.0.1#你允许的ip
deny all;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_pass unix:/tmp/php-cgi.sock;
}配置好之后重启一下nginxservice nginx restart看一下能不能访问
添加监控的shlle脚本
php-fpm_status.sh
添加zabbix-agent配置
php-fpm_status.conf
重启zabbix-agentservice zabbix-agent restart测试zabbix_get -s 127.0.0.1 -k slow.requests如果没有问题导入模板
php-fpm_status.xml
现在就能看到数据了
QQ交流群:136351212
查看原文:http://www.phpsong.com/2086.html
要nginx能输出php-fpm的状态必须要先修改php-fpm的配置,这个配置没有开启nginx 就没有办法输出php-fpm status
修改/usr/local/php/etc/php-fpm.conf 文件
注意:不是php.ini,如果没有配置添加配置
pm.status_path = /status重启php-fpmservice php-fpm restart添加nginx的配置
打开/usr/local/nginx/conf/nginx.conflocation /status {
allow 127.0.0.1#你允许的ip
deny all;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_pass unix:/tmp/php-cgi.sock;
}配置好之后重启一下nginxservice nginx restart看一下能不能访问
添加监控的shlle脚本
php-fpm_status.sh
添加zabbix-agent配置
php-fpm_status.conf
重启zabbix-agentservice zabbix-agent restart测试zabbix_get -s 127.0.0.1 -k slow.requests如果没有问题导入模板
php-fpm_status.xml
现在就能看到数据了
QQ交流群:136351212
查看原文:http://www.phpsong.com/2086.html
相关文章推荐
- PHP预定义超全局数组 $_ENV 、$GLOBALS 讲解
- PHP——生成随机数和日期时间
- PHP数组
- php实现子字符串位置相互对调互换的方法[原创]_php技巧_脚本之家
- 收藏一个Yaf教程
- php rand()和mt_ran(),还有随机数生成器
- php.ini修改php上传文件大小限制的方法详解
- phpstorm10.0.2三月22号补丁原来的网址被封了
- thinkphp如何去掉index.php
- 关闭浏览器报 getOutputStream() has already been called for this response
- 最好的vsftpd配置教程
- PHP function_exists的一个坑
- 史上最详细的vsftpd配置文件讲解
- 每天laravel-20160820| ContextualBinding
- 每天laravel-20160820| ContextualBinding
- php artisan migrate : [PDOException] could not find driver解决办法
- phpstudy自己电脑连接另一台电脑上的数据库
- 自定义ContentProvider及使用ContentResolver解析详细步骤
- Yii2杂记
- PHP3.2中Model层的in操作的实现,特别针对字符串的操作