grafana 使用 Node Exporter for Prometheus Dashboard 监控服务器基础信息

使用 Node Exporter for Prometheus Dashboard 监控服务器CPU 内存 磁盘 IO 网络 流量 温度等指标

当需要监控服务器的CPU 内存 磁盘 IO 网络 流量 温度等指标。可以使用 grafana 的 dashborad 。
插件名称:Node Exporter for Prometheus Dashboard
插件链接: https://grafana.com/grafana/dashboards/8919

第一步 导出插件

打开链接,复制 ID
grafana 使用 Node Exporter for Prometheus Dashboard 监控服务器基础信息_第1张图片

第二步 在 grafana 导入插件

将复制好的 ID 粘贴到 输入框中 点击 load
grafana 使用 Node Exporter for Prometheus Dashboard 监控服务器基础信息_第2张图片

第三步 选择数据源为Prometheus

grafana 使用 Node Exporter for Prometheus Dashboard 监控服务器基础信息_第3张图片
如果 数据源 中没有Prometheus 选项,说明没有服务器没有安装 Prometheus。此插件依赖 Prometheus 和 node_exporter。需要安装这两项。

安装 Prometheus

安装包下载地址: https://prometheus.io/download/
解压 :tar xvfz prometheus-*.tar.gz
启动:进入解压得到的文件夹运行 ./prometheus &

安装 node_exporter

安装包下载地址: https://github.com/prometheus/node_exporter/releases/
解压 :tar xvfz node_exporter-*.tar.gz
启动:systemctl start node_exporter1

将 node_exporter 配置入 Prometheus targets监控里面

找到 prometheus.yml 文件:

  - job_name: 'linux'
    static_configs:
      - targets: ['localhost:9100']
        labels:
          instance: node1

增加一个 node_exporter

scrape_configs:

  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']

  - job_name: 'node_exporter'
    static_configs:
      - targets: ['localhost:9100']

重启Prometheus 即可

你可能感兴趣的:(运维)