Prometheus安装和配置node_exporter监控主机

本文介绍了Node_exporter的安装步骤及其与Prometheus的配置方法,并提供了Grafana的模板下载地址。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Node_exporter是可以在* Nix和Linux系统上运行的计算机度量标准的导出器。

Node_exporter 主要用于暴露 metrics 给 Prometheus,其中 metrics 包括:cpu 的负载,内存的使用情况,网络等。

官方下载地址:https://github.com/prometheus/node_exporter/releases/download/v0.17.0/node_exporter-0.17.0.linux-amd64.tar.gz

1、安装Node_exporter

解压缩node_exporter并将目录重命名为“node_exporter”放到/usr/local/下。

tar -xf node_exporter-0.17.0.linux-amd64.tar.gz
mv node_exporter-0.17.0.linux-amd64 /usr/local/node_exporter

 放在后台启动即可:

nohup ./node_exporter &

 2、修改Prometheus的配置文件 prometheus.yml的scrape_configs下添加node_exporter,后重启Prometheus。

scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['localhost:9090']
  - job_name: 'node_exporter'
    static_configs:
      - targets: 
        - '172.31.182.140:9100'
        - '172.31.182.141:9100'
        - '172.31.182.142:9100'
        - '172.31.182.143:9100'
        - '172.31.182.144:9100'
        - '172.31.182.145:9100'
        - '172.31.182.146:9100'
        - '172.31.182.147:9100'

 3、添加granfana

模板下载地址:https://grafana.com/api/dashboards/1860/revisions/13/download

导入后的效果:

 

转载于:https://www.cnblogs.com/Dev0ps/p/10668116.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值