Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxmox VE 安装 Node Exporter 监控 #348

Open
Bpazy opened this issue Dec 24, 2024 · 0 comments
Open

Proxmox VE 安装 Node Exporter 监控 #348

Bpazy opened this issue Dec 24, 2024 · 0 comments

Comments

@Bpazy
Copy link
Owner

Bpazy commented Dec 24, 2024

此方案依赖 Docker,安装方法: #347

新建 docker-compose.yaml 文件:

version: '3.7'
services:
  node-exporter:
    image: prom/node-exporter:v1.3.1
    container_name: node-exporter
    network_mode: "host"
    pid: "host"
    restart: always
    volumes:
      - /proc:/host/proc
      - /sys:/host/sys
      - /:/host
      - /dev:/host/dev
    command:
      - "--path.procfs=/host/proc"
      - "--path.sysfs=/host/sys"
      - "--path.rootfs=/host"
    privileged: true

如果机器会被公网访问到,可以添加 --web.listen-address=192.168.1.100:9100 来限制只有特定的网络接口可以访问,比如我这里限制只能从 tailscale 接口访问,则配置如下:

    command:
      - "--path.procfs=/host/proc"
      - "--path.sysfs=/host/sys"
      - "--path.rootfs=/host"
      - "--web.listen-address=100.75.192.23:9100"

然后启动: docker compose up -d

最后验证:

root@pve:~/node-exporter# curl localhost:9100/metrics
# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 0.000127245
go_gc_duration_seconds{quantile="0.25"} 0.000127245
go_gc_duration_seconds{quantile="0.5"} 0.000159044
go_gc_duration_seconds{quantile="0.75"} 0.000159044
go_gc_duration_seconds{quantile="1"} 0.000159044
go_gc_duration_seconds_sum 0.000286289
go_gc_duration_seconds_count 2
......
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant