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

相关文章
相关标签/搜索