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