监控linux机器
下载node-exporter 的tar包
wget https://github.com/prometheus/node_exporter/releases/download/v1.0.1/node_exporter-1.0.1.linux-amd64.tar.gz
解压安装
tar xf node_exporter-1.0.1.linux-amd64.tar.gz -C /usr/local/
启动
/usr/local/node_exporter-1.0.1.linux-amd64/node_exporter &

在prometheus配置文件添加监控项
vim /usr/local/prometheus/prometheus.yml
ps:node-exporter默认端口为9100
- job_name: 'Prometheus'
static_configs:
- targets: ['10.15.5.225:9100']
labels:
instance: Prometheus
重启prometheus
grafana 安装piechart 插件,不安装的话会显示不出图像。将下载好的插件解压到grafana的插件目录重启即可。
grafana插件目录:/var/lib/grafana/plugins
- piechart插件:
- 链接: https://pan.baidu.com/s/19la6sMCdipPSVkjZsX33Mw 提取码: urcn

导入已有的dashboard
我这里也是用的别人已经画好的,可以到Grafana 的仪表盘市场:https://grafana.com/grafana/dashboards去下载
这是我用的:
链接: https://pan.baidu.com/s/1mClzdBXVHLkNzJ8oXv3mBg
提取码: 8spk

之后可以直接导入文件,也可以直接复制文件中的内容到下面输入框


我这边是已经导入了所以有警告,以及下面的覆盖提示
之后就能看到对应的监控项啦~

本文介绍了如何在Linux系统上安装和启动node_exporter,以便于Prometheus进行监控。首先,通过wget下载并解压node_exporter的tar包,然后将其添加到Prometheus的配置文件中作为监控目标。接着,展示了如何在Grafana中安装piechart插件以展示监控数据,并导入预设的dashboard。最后,提醒读者注意导入dashboard时可能出现的警告和覆盖提示。
node-exporter&spm=1001.2101.3001.5002&articleId=110081386&d=1&t=3&u=717e0192e46b45d28f5de845cdabcde8)
372

被折叠的 条评论
为什么被折叠?



