Rollout: Telegraf gatherers on PVE hosts and guests (drafted 2026-11-24)

Goal: every PVE host and guest runs Telegraf and writes to the central relay on werner, which already fans out to VictoriaMetrics, TimescaleDB and GreptimeDB. PVE hosts additionally run fleet-joules (FleetObs) under inputs.execd. The PVE Metric Server push stays as it is.

Config templates: config/gatherer/. Nothing here has been applied to a host yet. Items marked [check] are not verified.

0. Decisions needed before the first host

#DecisionRecommendation
1Listener tokenSW-CRED-01 in docs/secrets.md; recycling tracked in SterreWag#1. Recycle before it goes on the fleet. The PVE Metric Server entries (/etc/pve/status.cfg, one per cluster) use the same token.
2One shared token or separate listenersinfluxdb_v2_listener takes one token. For per-source revocation, add a second listener on another port for gatherers. Start with one.
3Buckets (btag)By data class, not by host: see "Buckets" below. Names proposed, not yet agreed.
4Transport securityThe listener is plain HTTP. Acceptable on the management network for a pilot; add TLS on the listener before guests on tenant networks write to it.
5Telegraf versionDecided 2026-11-24: latest stable from the InfluxData Debian repo through apt-cacher-ng, on the relay and on every gatherer, upgraded frequently. No version pin or hold. See section 3.
6Pilot hostsDecided 2026-11-24: templeton (charlottesweb), werner (standalone; also hosts the relay), and qe2: arctic, atlantic, pacific, indian (Ceph, no ZFS pools expected).
7Deployment toolA telegraf_gatherer role in ansible-ops (run from Semaphore), with the pilot host done by hand first to settle the config.

Questions from Hardy's side (asked on Zulip, AI › Telemtry-AI-energy, 2026-11-27)

#QuestionFromNotes
8May hr, hr2 and rc write host basics (CPU, memory, disk, network) to the relay every 10 s?Johlan (4951358)Decided 2026-12-01: yes, 10 s is fine. They are guests on our PVE hosts, run by Hardy's side. They hold until the new token exists. Answered on Zulip 2026-12-01 (4951768).
9What limit should the trial stay under, as samples or disk per day? Their estimate: ~40 values/s, ~3.3M samples/day. They report real TSDB numbers after week one.Johlan (4951358)Decided 2026-12-01: their estimate is fine in principle; no number is set until the pilot hosts have been measured. Answered on Zulip 2026-12-01 (4951768).
10On hr, hr2 and rc: use our install.sh with --role guest, or their own Telegraf install writing to bucket guest?Shannon, Johlan's Claude (4951366)Decided 2026-12-01: their own script is fine, and they share it with us so we know what to expect. They do not write to guest: internal guests push to their own tenant bucket, see "Tenant buckets" below. Answered on Zulip 2026-12-01 (4951768).
11Will the Telegraf on atlantic, indian and arctic read whole-server power from the management card, for example ipmi_sensor (DCMI) every 60 s? Their fallback is LibreNMS's InfluxDB export through the relay, which sends every device's data.Shannon (4951370)Open, waiting on Hendrik (told them "noted, not decided", 4951768). Needs ipmitool and /dev/ipmi0 access for the telegraf user on those hosts, and [check] that their BMCs answer DCMI power reading. Would go to bucket energy as a sensors-style drop-in. Fits phase 4 at the earliest.

Follow-on from 8 and 10 for decision 2: hr, hr2 and rc are writers outside our administration. Recommendation: give Hardy's side its own listener (second influxdb_v2_listener, own port and token, SW-CRED-06) so their token can be revoked or recycled without touching the PVE hosts.

Buckets

The bucket says what kind of data it is, because that is what sets retention, resolution and who reads it. Which host, cluster or guest is a tag, never a bucket. That holds for the infrastructure buckets below; tenant guests are the exception ("Tenant buckets").

Bucket (btag)ContentsSourceRateRetention idea
energyfleet_* from fleet-joules: RAPL joules, per-guest and host CPU timeexecd input on PVE hosts~1 s180 d raw (the Zulip estimate), then downsample
pve-hostOS view of the hypervisor: cpu, mem, disk, diskio, net, zfs, sensorsTelegraf on PVE hosts10–60 smedium
guestOS view from inside a VM/CTTelegraf in guests10–60 smedium
*(existing)*PVE Metric Server push: PVE's own view of nodes, guests and storagePVE10 sunchanged; [check] its bucket name on the relay

Tags that select within a bucket: host (node or guest name), cluster, and for energy the guest tag fleet-joules emits. "Energy for templeton" is bucket energy, host="templeton"; "all of qe2" is cluster="qe2".

How it is routed: the gatherer has one output with bucket_tag = "btag". global_tags sets the machine's default (SW_BUCKET = pve-host or guest), and an input overrides it with [inputs.X.tags] btag = "energy". The relay's listener and outputs already use btag, so no relay change is needed for routing.

Per TSDB: VictoriaMetrics turns the bucket into a db label; GreptimeDB uses it as the database name, which [check] may have to be created first; TimescaleDB ignores it (one database), so only the btag column differs.

Tenant buckets (Hendrik, 2026-12-01)

Guests that belong to a tenant push to their own bucket, not to the shared guest bucket.

Open points:

1. Central relay preparation (werner, Hendrik)

  1. Re-snapshot the live config into config/central/telegraf.conf before changing it.
  2. Rotate the listener token (decision 1). Move the token and the TimescaleDB DSN out of the file into /etc/default/telegraf.
  3. Set debug = false; at fleet volume debug logging is large.
  4. Raise metric_buffer_limit (50000 per output today) to cover a TSDB outage at the new rate, or accept the loss. Rough rate: 19 hosts × ~18 metrics/s plus guests. [check] with the pilot host's real numbers.
  5. Measurement-name collisions [check]: the PVE push already writes measurements such as system, and Telegraf's inputs.system, cpu, mem and net use overlapping names with different tags and fields.
    • VictoriaMetrics and GreptimeDB separate them by bucket (btag), so a distinct bucket is enough.
    • TimescaleDB has one database and one table per measurement. outputs.postgresql will add columns to the existing tables, and a field with the same name but another type will be rejected. Check the system, cpu and mem tables against the pilot's output before the fleet goes on. If they clash, give the PostgreSQL output a tagpass/namepass split or rename gatherer measurements with a processor on the relay.
  6. The existing processors.regex on net (tap → vmid) also applies to gatherer net metrics. The gatherer template excludes tap interfaces, so nothing changes.
  7. Firewall: allow TCP 7369 to 2c0f:fc78:feef:e000:1:2:3:13 from every cluster's management prefix, and from guest networks once guests are added.
  8. DNS: DNS-Stuff#13. Gatherers use the address literal until telegraf.error.net.za is clean.

2. Per-host preflight (read-only)

Run on each PVE host before installing:

pveversion                                    # PVE 8 (bookworm) or 9 (trixie)
hostname; cat /etc/hostname                   # must equal the PVE node name
curl -6 -sS -o /dev/null -w '%{http_code}\n' 'http://[2c0f:fc78:feef:e000:1:2:3:13]:7369/health'   # expect 200
ls -l /sys/class/powercap/intel-rapl:*/energy_uj   # RAPL present? (AMD needs the intel_rapl_msr module)
cat /sys/class/powercap/intel-rapl:*/name /sys/class/powercap/intel-rapl:*/max_energy_range_uj
stat -fc %T /sys/fs/cgroup                    # cgroup2fs expected
ls /sys/fs/cgroup/qemu.slice /sys/fs/cgroup/lxc 2>/dev/null | head   # guest cgroup layout fleet-joules walks
ls /dev/ipmi0 2>/dev/null; command -v ipmitool sensors
systemctl is-active telegraf 2>/dev/null      # is something already there?

Record the results per host: RAPL zones (sockets), PPT if above 400 W (--max-watts), cgroup layout, IPMI. A host with no RAPL zones gets Telegraf without fleet-joules.

2a. Install script

config/gatherer/install.sh does sections 3, 4 and 5 in one run: apt key and source, latest Telegraf, the initial configs, /etc/default/telegraf, optionally fleet-joules, a telegraf --test, then enable and start. The sections below describe what it does and are the manual fallback.

# on the workstation: bundle the gatherer directory (and, for PVE hosts, the fork's deploy/ directory)
tar -C config -czf gatherer.tgz gatherer
tar -C ../fleetobs -czf fleetobs-deploy.tgz deploy          # checkout on branch ecs/execd
scp gatherer.tgz fleetobs-deploy.tgz [email protected]:/root/

# on the host, as root; the token file comes from the secrets custodian, not from this repo
tar xzf gatherer.tgz && tar xzf fleetobs-deploy.tgz
./gatherer/install.sh --dry-run --role pve-host --cluster charlottesweb --token-file /root/relay.token
./gatherer/install.sh           --role pve-host --cluster charlottesweb --token-file /root/relay.token \
    --fleet-joules ./deploy --fleet-joules-bin <URL on apter> --fleet-joules-sha256 <sha256>
shred -u /root/relay.token

3. Install Telegraf on a PVE host

  1. Package: current stable from the InfluxData Debian repo, fetched through apt-cacher-ng on apter (hosts need no direct internet). Files are in config/gatherer/apt/:
    install -m 0644 influxdata-archive.asc /etc/apt/keyrings/influxdata-archive.asc
    install -m 0644 influxdata.sources     /etc/apt/sources.list.d/influxdata.sources
    apt-config dump | grep -i 'Acquire::http::Proxy'   # must show apter:3142 (base role); the source is plain http://
    apt update && apt-cache policy telegraf   # candidate = newest in the repo (1.40.4-1 on 2026-11-24)
    apt install telegraf
    systemctl stop telegraf                   # the package starts it with the stock config
    • Verified from Hclaude01 on 2026-11-24: http://repos.influxdata.com/debian answers through the cache at apter:3142, newest is 1.40.4-1, and InRelease verifies with the committed key. Not yet run on a PVE host.
    • Key: primary 24C975CBA61A024EE1B631787C3D57159FC2F927, signing subkey AC10D744…0585BD3B (expires 2029-01-17), sha256 of the file 40557e26…904d5dac. The copy on apter (/files/keys/influxdata-archive.key, and in KeyRing.asc) is stale: it only has the subkey that expired 2026-01-17, so it cannot verify this repo. Refresh tracked in apter-keys-dls#1.
    • The cache refuses non-repository paths (403 for the key URL), so the key is shipped from this repo.
    • No pin: hosts follow the repo's latest, as the relay does. An upgrade restarts Telegraf; with the memory buffer that loses only what was unsent at that moment. Read the release notes on a new minor for removed options.
  2. Config: config/gatherer/telegraf.conf → /etc/telegraf/telegraf.conf, the drop-ins in telegraf.d/ → /etc/telegraf/telegraf.d/: base.conf and kernel.conf always, zfs.conf only with ZFS (not the qe2 Ceph hosts), sensors.conf only with lm-sensors.
  3. Environment: /etc/default/telegraf, root:telegraf 0640, holding INFLUX_LISTENER_TOKEN, SW_BUCKET=pve-host and SW_CLUSTER=<cluster>. The token is delivered by the secrets custodian, never through Zulip or git.
  4. Dry run, then start:
    set -a; . /etc/default/telegraf; set +a
    sudo -u telegraf --preserve-env=INFLUX_LISTENER_TOKEN,SW_BUCKET,SW_CLUSTER \
      telegraf --config /etc/telegraf/telegraf.conf --config-directory /etc/telegraf/telegraf.d --test | head -40
    systemctl enable --now telegraf
    journalctl -u telegraf -n 30 --no-pager
  5. Verify on VictoriaMetrics that the host's series arrive (db="pve-host", host="<node>"), and on the relay that there are no write errors for TimescaleDB.

4. FleetObs fleet-joules on a PVE host

Source: our fork hclaude/fleetobs, branch ecs/execd, version 1.2.0 (../fleetobs). Upstream OntologyLabs/fleetobs has only the inputs.exec and file modes; see docs/fleetobs.md.

What the branch provides (mode C in its deploy/README.md, the recommended one):

Status of the branch (2026-11-24): 191 tests pass; execd (both signals) and the socket mode were run under a real Telegraf 1.36.4 against fixture directories. Not yet run under systemd or on a PVE host: the sysusers, tmpfiles, udev and unit files are unexercised, so the first pilot host is their test. Not yet run under Telegraf 1.40.

Steps (files are under deploy/ in the fork):

  1. Binary: where it is built is not decided. It must not come from a workstation build. Proposal: a Forgejo runner builds the fork's tagged source as a static musl binary (bookworm and trixie) and publishes it on the apter mirror with a .source marker and sha256; tracked in apter-keys-dls#2. Install as /usr/local/bin/fleet-joules (root:root 0755). Until then, Telegraf goes on without fleet-joules.
  2. Group and grant:
    install -m 0644 sysusers.d/fleet-joules.conf /etc/sysusers.d/ && systemd-sysusers fleet-joules.conf
    install -m 0644 tmpfiles.d/fleet-joules.conf /etc/tmpfiles.d/ && systemd-tmpfiles --create fleet-joules.conf
    ls -l /sys/devices/virtual/powercap/intel-rapl/intel-rapl:*/energy_uj   # expect -r--r----- root fleet-joules
    ls -ld /run/fleet-joules-state                                           # expect drwx------ telegraf telegraf

    This is the first real test of z on a sysfs attribute. If the mode or group did not change, stop and use mode D.

  3. Telegraf unit drop-in: install -D -m 0644 systemd/telegraf.service.d/fleet-joules.conf /etc/systemd/system/telegraf.service.d/fleet-joules.conf, then systemctl daemon-reload.
  4. Optional: udev/70-fleet-joules.rules → /etc/udev/rules.d/. It re-applies the grant if the RAPL module is reloaded while Telegraf runs; without it energy shows as fleet_energy_unmeasured until Telegraf restarts.
  5. telegraf.d/fleet-execd.conf → /etc/telegraf/telegraf.d/. Two local edits:
    • Append to the [[inputs.execd]] block, as its last lines, the bucket override:
        [inputs.execd.tags]
          btag = "energy"
    • Add "--max-watts", "<W>" to command if the preflight shows a socket PPT above 400 W.
  6. Check by hand as Telegraf would run it, then restart:
    sudo -u telegraf -g fleet-joules /usr/local/bin/fleet-joules --once --no-host | head
    systemctl restart telegraf; journalctl -u telegraf -n 30 --no-pager

    Also confirm the telegraf user can read the guest cpu.stat files (fleet_guest_cpu lines present, no fleet_guest_cpu_unmeasured); that was not verifiable off-host.

  7. Verify on the TSDBs: fleet_energy, fleet_guest_cpu and fleet_host_cpu arrive every second in bucket energy, total_uj only rises, and there are no fleet_energy_discontinuity or fleet_energy_unmeasured points in steady state. Reboot the pilot host once: the grant must come back, and the total restarts with a fleet_energy_state_reset line.

Install exactly one of fleet-execd.conf, fleet-socket.conf, fleet-exec.conf, fleet-file.conf: they share one state lock, and a second instance exits 4.

IPMI power (fleet-ipmi.conf) stays out until ipmitool dcmi power reading answers on that host.

5. Install Telegraf in guests

6. Order of work (Hendrik, 2026-12-01)

Each phase has to work before the next one starts.

PhaseWhatDone whenSections
1Finish and audit the central relay on wernerConfig re-snapshotted, token recycled (SW-CRED-01), debug off, buffer and firewall settled1
2Plain Telegraf (no fleet-joules) on the PVE hosts we know, pilot hosts first, templeton firstpve-host data from each host arrives at the relay without errors2, 2a, 3
3Set up and verify the TSDB side, VictoriaMetrics firstPhase 2 data is queryable per host and cluster; load numbers recorded (below)tsdb.md
4Test the fleet-joules reader on templetonfleet_* in bucket energy every second; 24 h soak; cost on the TSDBs known4
5Johlan and Hardy point their guest Telegrafs (hr, hr2, rc) at the relay; check the feeds in the TSDBsTheir tenant bucket shows data; their shared script reviewed5, "Tenant buckets"

After phase 5: the telegraf_gatherer Ansible role, remaining hosts (Charlotte's Web, duckpond, qq, standalones), our own guests, and the PR to OntologyLabs/fleetobs when Hendrik asks for it.

Until phase 5, Hardy's side keeps holding its writes. Question 9 (the limit) is answered from the phase 3 and 4 numbers.

What Hardy and Johlan expect from the TSDB side (from the Zulip topic)