netbird-telegraf-installer

Ein Befehl, und eine Node liefert Metriken + Logs an den zentralen Collector im NetBird-Netz (Prometheus Remote Write :9090, Loki :3100, Grafana :3000 — alle auf 100.83.134.46).

Voraussetzung: Die Node ist NetBird-Peer und erreicht 100.83.134.46. Kein Tunnel, keine Freigabe nach außen.

Linux — Debian, Ubuntu, Proxmox VE, RHEL/Rocky/Alma/Fedora, Alpine, sonstige

curl -fsSL https://gitea.m-m.bio/mm/netbird-telegraf-installer/raw/branch/main/install.sh | sudo sh -s -- --name <node-name>
Option Bedeutung
--name <n> Node-Name im Dashboard (Default: hostname -s)
--collector <ip> Collector-IP (Default 100.83.134.46)
--role proxmox|apache|docker|none Zusatz-Profil; Default auto erkennt Proxmox, Docker und Apache selbst
--pve-token 'telegraf@pve!monitoring=…' Proxmox-API-Token für VM/CT-Metriken
--apache-log <pfad> Access-Log (Default /var/log/apache2/access.log)
--uninstall alles entfernen

Ablauf: Paketquelle von InfluxData (apt/dnf/apk) oder statisches Binary (amd64/arm64/armv7) → /etc/telegraf/telegraf.conf + telegraf.d/ aus diesem Repo → /etc/default/telegraf mit NODE_NAME/COLLECTOR → systemd-Dienst telegraf, enabled, Konfig-Test vor dem Start.

Proxmox VE

pveum user add telegraf@pve
pveum user token add telegraf@pve monitoring -privsep 1     # Secret notieren
pveum acl modify / -token 'telegraf@pve!monitoring' -role PVEAuditor
curl -fsSL https://gitea.m-m.bio/mm/netbird-telegraf-installer/raw/branch/main/install.sh | sh -s -- --name pve1 --pve-token 'telegraf@pve!monitoring=<secret>'

Apache

Wird automatisch erkannt (apache2ctl/httpd). Access-Log geht roh nach Loki. Für Request-Metriken inputs.apache in telegraf/apache.conf einschalten (braucht mod_status).

Windows — PowerShell als Administrator

Set-ExecutionPolicy Bypass -Scope Process -Force
iwr -useb https://gitea.m-m.bio/mm/netbird-telegraf-installer/raw/branch/main/install.ps1 | iex

Mit Parametern: & ([scriptblock]::Create((iwr -useb …/install.ps1))) -Name mypc Installiert nach C:\Program Files\Telegraf, Dienst telegraf; liefert CPU/RAM/Disk/Net/Dienste + Eventlog (Warnung/Fehler) an den Collector. -Uninstall entfernt alles.

Docker-Host ohne root

Wer kein sudo hat, aber in der Gruppe docker ist: Container-Variante aus netbird-observability/stacks/telegraf-node (privates Repo).

Prüfen

curl -s 'http://100.83.134.46:9090/api/v1/query?query=system_uptime{node="<node-name>"}'
journalctl -u telegraf -f

Im Grafana-Dashboard „NetBird Observability — Overview“ erscheint die Node automatisch im Node-Filter.

Sicherheit

  • Der Collector akzeptiert unauthentifiziert — er ist nur über das NetBird-Interface erreichbar.
  • Telegraf läuft als Benutzer telegraf (Docker-Socket read-only via Gruppe docker, Apache-Logs via Gruppe adm).
  • Dieses Repo ist öffentlich und enthält keine Secrets. Tokens landen nur in /etc/default/telegraf (0600).
S
Description
One-liner Telegraf installer for NetBird observability nodes (Linux/Proxmox/Windows) → Prometheus Remote Write + Loki
Readme MIT
986 KiB
0 Stars 1 Watchers 0 Forks
Languages
Shell 57.2%
Python 37.5%
PowerShell 5.3%