prometheus監控linux系統

安裝node exporternode

建立Systemd服務mysql

複製代碼
#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_exporterlinux

# systemctl start node_exporter
# systemctl status node_exporter

驗證git

curl http://localhost:9100/metrics

添加prometheus相關配置github

複製代碼
# vi prometheus280/prometheus.yml

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

重啓prometheus便可sql

 

  grafana dashboardvim

https://grafana.com/dashboards/8919curl

注意事項:

須要安裝餅圖的插件:

須要重啓grafanaservice grafana-server restartgrafana-cli plugins install grafana-piechart-panel # 請確保安裝後能正常添加餅圖。

https://github.com/starsliao/Prometheusurl

相關文章
相關標籤/搜索