From 26a3ec3339fb2c40a7178ac87fde0c1b68ba23dd Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 14 Oct 2026 22:20:11 -0400 Subject: [PATCH] feat(alerts): the host's temperature and throughput can drive alert rules (#5787) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit temp_c_max was recorded on every ingest, but host_agent didn't offer it to rules, so "host running hot" couldn't be watched. The catalog guard didn't see the row(...) helper ingest builds its rows with. Now offered: temp_c_max, temp_c per sensor, and network and disk throughput per host, interface and disk. A new guard holds every literal row(...) name to the catalog, except NOT_ALERTABLE, where each exclusion is given a reason. temp_c_max reads in °C. Co-Authored-By: Claude Opus 5.5 --- docs/plugins/host-agent-design.md | 2 ++ plugins/host_agent/__init__.py | 20 +++++++++++++++++++- steward/core/formatting.py | 10 ++++++++-- tests/core/test_formatting.py | 4 ++++ tests/core/test_metric_catalog.py | 24 ++++++++++++++++++++++++ 5 files changed, 57 insertions(+), 3 deletions(-) diff --git a/docs/plugins/host-agent-design.md b/docs/plugins/host-agent-design.md index c30387f..01dcabf 100644 --- a/docs/plugins/host-agent-design.md +++ b/docs/plugins/host-agent-design.md @@ -271,6 +271,8 @@ A board's spare thermistor inputs (a Nuvoton's SYSTIN, AUXTIN*) are often wired The verdicts are kept in memory and rebuilt at startup, so ingest and the host page read them without a query. The host page lists the sensors left out under "Not counted", each with its reason. A host with no CPU reading, or too little history, falls back to the value rule alone. +`temp_c_max` can drive an alert rule (#5787), e.g. "Host running hot": all hosts, over 85 °C for 10 consecutive checks. So can each sensor's `temp_c`, and the per-interface and per-disk throughput. `tests/core/test_metric_catalog.py` holds every metric ingest writes to the alert catalog, except the few `NOT_ALERTABLE` names in `plugins/host_agent/__init__.py`. + ### Logging To stderr only (systemd captures to journal). No file logging, no log rotation. Levels: diff --git a/plugins/host_agent/__init__.py b/plugins/host_agent/__init__.py index b8a7ba5..3140582 100644 --- a/plugins/host_agent/__init__.py +++ b/plugins/host_agent/__init__.py @@ -78,7 +78,18 @@ def get_alert_metrics() -> dict[str, list[str]]: reboot_required is 1 when the host needs a reboot (agent ≥ 1.16.0): "security updates waiting" is updates_security > 0. maintenance_failed comes from the scheduler (#5768): 1 when the host's latest maintenance job - failed or timed out, 0 once one succeeds: "maintenance failed" is > 0.""" + failed or timed out, 0 once one succeeds: "maintenance failed" is > 0. + temp_c_max is the host's hottest real thermometer, in °C (#5787); sensors + with nothing wired to them are left out (#5759, #5783): "running hot" is + > 85. temp_c is one sensor, resource ":temp: