Node_exporter是可以在* Nix和Linux系統上運行的計算機度量標准的導出器。
Node_exporter 主要用於暴露 metrics 給 Prometheus,其中 metrics 包括:cpu 的負載,內存的使用情況,網絡等。
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

導入后的效果:

