Prometheus 监控Haproxylinux
普罗米修斯是一个完整的监控和趋势系统,包括基于时间序列数据的内置和主动刮削,存储,查询,绘图和警报,如下使用Prometheus+grafana对Haproxy进行监控,关于prometheus和Haproxy安装再也不赘述。git
安装Haproxy_exporter https://github.com/prometheus/haproxy_exporter/releases/download/v0.9.0/haproxy_exporter-0.9.0.linux-386.tar.gz tar xf haproxy_exporter-0.9.0.linux-386.tar.gz cd haproxy_exporter-0.7.1.linux-amd64 cp haproxy_exporter /usr/bin #192.168.1.1 本地服务器IP #5000 Haproxy端口 #9100 监控端口 haproxy_exporter --haproxy.scrape-uri="http://192.168.1.1:5000/baz?stats;csv" --web.listen-address="192.168.1.1:9100" &
Prometheus配置添加 find / -name prometheus.yml vi /etc/prometheus.yml ##新增 - job_name: haproxy scrape_interval: 1s scrape_timeout: 1s metrics_path: /metrics scheme: http static_configs: - targets: - 192.168.1.1:9101 labels: instance: haproxy:9101
地址:https://grafana.com/api/dashboards/2428/revisions/7/downloadgithub
参考来源:web
http://www.javashuo.com/article/p-gywcnlfk-cw.htmljson
https://grafana.com/dashboards/367api
https://grafana.com/dashboards/2428/revisions服务器
https://blog.csdn.net/felix_yujing/article/details/75571073 Prometheus采集用的exporter.net