grafana+prometheus监控linux指标

先查看linux架构

root@node-0006 node_exporter-1.6.1.linux-amd64# uname -m

aarch64

我服务器是ARM 架构

所以是下载适用于 ARM64 的 Node Exporter:

新建一个文件夹 进入

复制代码
wget https://github.com/prometheus/node_exporter/releases/download/v1.6.1/node_exporter-1.6.1.linux-arm64.tar.gz
复制代码
tar -xzf node_exporter-1.6.1.linux-arm64.tar.gz
cd node_exporter-1.6.1.linux-arm64

确保 node_exporter 文件具有可执行权限:

chmod +x node_exporter

启动 Node Exporter:

复制代码
./node_exporter

如果看到大量以 node_ 开头的指标,表示 Node Exporter 已成功运行。

可以用目标服务器 curl http://localhost:9100/metrics

如果服务器是内网,用nginx配置 转发

location /linux_metrics {

proxy_pass http://服务器ip:9100/metrics;

}

这样就用域名访问https://域名/linux_metrics

scrape_configs:

  • job_name: 'prometheus'

static_configs:

  • targets: 'localhost:9090'

  • job_name: 'linux_node_exporter'

metrics_path: '/linux_metrics'

scheme: https

static_configs:

  • targets: '域名'

prometheus有指标了就行

grafana添加linux面板

相关推荐
Sokach101511 小时前
Linux Shell 脚本从零到能用:一个新手的一天学习总结
linux
AlfredZhao1 天前
Docker 容器时区不对,`timedatectl` 不存在怎么办?
linux·timezone
zzzzzz3102 天前
9K Star 炸裂开源!这个 C 语言写的代码知识图谱,把 Linux 内核索引压缩到了 3 分钟
linux·服务器·sql
XIAOHEZIcode2 天前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏
A小辣椒4 天前
TShark:Wireshark CLI 功能
linux
A小辣椒4 天前
TShark:基础知识
linux
AlfredZhao5 天前
OCI 明明分配了 200G 系统盘,为什么 df 只看到 30G?
linux·oci
AlfredZhao5 天前
vi 删除指定范围的行,不用再反复按 dd
linux·vi
用户9718356334665 天前
银河麒麟 KY10 申威(SW64) 安装 nginx-1.16.1-2.p01.ky10.sw_64.rpm 详细步骤
linux
猪脚踏浪5 天前
linux 拷贝文件或目录到指定的位置
linux