Prometheus监控PHP-FPM
2018-11-15 本文已影响0人
袁先生的笔记
环境
系统:CentOS 7.5
软件:php-fpm-exporter.linux.amd64
准备
PHP-FPM端
-
下载php-fpm-exporter
地址:https://github.com/bakins/php-fpm-exporter/releases -
安装php-fpm-exporter
# mkdir -p /usr/local/prometheus/php-fpm-exporter # mv php-fpm-exporter.linux.amd64 /usr/local/prometheus/php-fpm-exporter/php-fpm-exporter # chmod +x /usr/local/prometheus/php-fpm-exporter/php-fpm-exporter
-
启动php-fpm-exporter
# nohup /usr/local/prometheus/php-fpm-exporter/php-fpm-exporter --addr 0.0.0.0:9190 --endpoint http://127.0.0.1:9010/status > /usr/local/prometheus/php-fpm-exporter/php-fpm-exporter.log 2>&1 &
Prometheus端
-
配置Prometheus
# vim /usr/local/prometheus/prometheus.yml scrape_configs: - job_name: 'PHP-FPM' static_configs: - targets: - yuantong.zjcx-local.com:9190
-
重启Prometheus
# systemctl restart prometheus
Grafana端
- 添加dashboards
点击Create
-Import
,输入dashboards的id(推荐)