feat(hosts): the hottest sensor is named with its chip, and the host-reading cutoffs are read and set over MCP (#6806)
CI / lint (push) Successful in 1s
CI / unit (push) Successful in 1m39s
CI / integration (push) Successful in 2m2s
CI / publish (push) Successful in 1m12s

Agent 1.27.0 sends each temperature sensor's hwmon chip. Steward keeps the
chip per host and label beside the reading, so a sensor's metric key stays
its label, and the strip and the heat alert name it as "NVMe · Sensor 2"
rather than a bare "Sensor 2".

get_thresholds (viewer) and set_thresholds (admin, audited) read and change
the warn/crit cutoffs CPU, memory, disk, load and temperature are graded by,
as Settings → Thresholds does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-03 17:39:31 -05:00
co-authored by Claude Opus 5.5
parent 6eeb4039d7
commit 38ae99fb8e
9 changed files with 273 additions and 9 deletions
+5 -3
View File
@@ -22,7 +22,7 @@ from collections import deque
from concurrent.futures import ThreadPoolExecutor, wait as wait_futures
from datetime import datetime, timezone
AGENT_VERSION = "1.26.1"
AGENT_VERSION = "1.27.0"
# Default path to the local Docker Engine socket. Overridable via the
# `docker_socket` config key; collection is silently skipped if it's absent or
@@ -480,7 +480,9 @@ def nfs_delays(cur: dict, prev: dict, dt: float) -> list:
def collect_temps() -> list:
"""Return [{label, celsius}] from /sys/class/hwmon (best-effort, may be empty)."""
"""Return [{label, celsius, chip}] from /sys/class/hwmon (best-effort, may
be empty). `chip` is the hwmon driver's name (coretemp, nvme, nct6798…),
which says what a bare label like "Sensor 2" is measuring."""
out: list = []
try:
chips = os.listdir(HWMON_DIR)
@@ -511,7 +513,7 @@ def collect_temps() -> list:
except OSError:
pass
name = label or (f"{chip}_{idx}" if chip else idx)
out.append({"label": name, "celsius": round(milli / 1000.0, 1)})
out.append({"label": name, "celsius": round(milli / 1000.0, 1), "chip": chip})
return out