2025-02-20
树莓派
00
请注意,本文编写于 54 天前,最后修改于 54 天前,其中某些信息可能已经过时。

目录

安装
安装 node-export
安装 Prometheus
安装 grafana

基于 docker 搭建 node-exporter + Prometheus + Grafana 服务器监控平台 image.png

安装

安装 node-export

docker run -d --restart=always -p 9100:9100 prom/node-exporter

验证:访问 http://服务器IP:9100/metrics

image.png

安装 Prometheus

准备 /disk/app/prometheus/prometheus.ymlIP地址 替换成 node-exporter 所在服务器地址

yml
global: scrape_interval: 60s evaluation_interval: 60s scrape_configs: - job_name: prometheus static_configs: - targets: ['localhost:9090'] labels: instance: prometheus - job_name: linux static_configs: - targets: ['IP地址:9100'] labels: instance: localhost

创建 docker 容器 docker run -d --restart=always -p 9090:9090 -v /disk/app/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus

验证:访问 http://IP地址:9090 image.png

安装 grafana

docker run -d --restart=always --name grafana -p 3000:3000 grafana/grafana

访问 192.168.1.3:3000,用户名密码都是 admin

添加数据源 image.png

下载ID为11074的模板文件 image.png 使用下载的模板文件创建仪表盘 image.png 效果 image.png

如果对你有用的话,可以打赏哦
打赏
ali pay
wechat pay

本文作者:42tr

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!