prometheus監控linux系統


安裝node exporter

創建Systemd服務

復制代碼
#vim /etc/systemd/system/node_exporter.service
[Unit]
Description=mysql_exporter
After=network.target
[Service]
Type=simple
User=prometheus
ExecStart=/usr/local/prom/exporter/node_exporter_0170/node_exporter
Restart=on-failure
[Install]
WantedBy=multi-user.target
復制代碼

啟動node_exporter

# systemctl start node_exporter
# systemctl status node_exporter

驗證

curl http://localhost:9100/metrics

添加prometheus相關配置

復制代碼
# vi prometheus280/prometheus.yml

##linux##
  - job_name: 'node'
    static_configs:
    - targets: ['localhost:9100']
      labels:
          instance: lab1
復制代碼

重啟prometheus即可

 

  grafana dashboard

https://grafana.com/dashboards/8919

注意事項:

需要安裝餅圖的插件:
grafana-cli plugins install grafana-piechart-panel
# 請確保安裝后能正常添加餅圖。

需要重啟grafanaservice grafana-server restart

https://github.com/starsliao/Prometheus

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM