Skip to content

feat(ups): read the AP9335T rack-ambient probe on mjolnir's card - #1672

Merged
Gerrrt merged 3 commits into
mainfrom
gerrrt/mjolnir-temperature-probe
Nov 23, 2026
Merged

Gerrrt merged 3 commits into
mainfrom
gerrrt/mjolnir-temperature-probe

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Nov 23, 2026

Copy link
Copy Markdown
Owner

What changed

mjolnir's card now reports its AP9335T temperature probe over SNMP, and three new rules watch it.

  • SNMP: the apc_ups module walks uioSensorStatusTable (PowerNet-MIB, .318.1.1.25.1.2). That table holds degrees C, the card's violation status, its alarm status and the probe's comms status. The sensor name is attached as a label. Degrees F and humidity are not collected; humidity reads -1 on a temperature-only probe.
  • UpsTemperatureProbeMissing: the card answers but the table is empty. This is also the check that an NMC3 reports the probe in this table and not the older iemStatusProbes one.
  • UpsTemperatureProbeCommsLost: the probe isn't talking to the card.
  • RackAmbientTemperatureAlarm: the card's own alarm on the probe has fired.
  • Buy list: the probe leaves Everything still to buy, so README goes from 11 items to 10. hardware.md and the changelog record it.

Why

The operator reports the probe is bought and plugged into the card's universal I/O port, but the roadmap still listed it as unbought. Collecting it is the generator change the purchase row called for.

No fixed temperature limit yet. PowerNet-MIB says uioSensorStatusTemperatureDegC is in tenths of a degree, but APC's cards have been seen to report whole degrees in that column. A threshold follows once the first readings show which. Until then, the limits set on the card do the job, through RackAmbientTemperatureAlarm.

Blast radius

  • What it touches: the observability stack's snmp-exporter config and the Prometheus rules only.

  • If the table guess is wrong: UpsTemperatureProbeMissing fires (warning) and nothing else changes.

  • Extra SNMP load: the walk adds one small table to a scrape that takes about 0.2 s today.

  • No change to network segmentation or firewall rules

  • No new port published to a VLAN that could not already reach the service

  • No credential added outside secrets/*.sops.yaml

Verification

  • make snmp-generate: total metrics 1794 → 1798; apc_ups gains the 4 sensor columns. The SNMPv3 placeholders survive.

  • promtool (ups.test.yaml): SUCCESS. The new cases cover the production shape (all three rules quiet), table missing, card down (quiet), comms lost, and the card alarm.

  • make validate: the only failure was yamllint, on four test-series lines over 120 characters. After wrapping them and rebasing onto main, ./scripts/lint.sh passes everything and the UPS promtool run passes. The full suite was not rerun.

  • Skipped in that run: backup-offsite.sh's path refusal (/tmp is a tmpfs here; CI covers it), plus the unit-syntax, installed-timer and sensitive-stack checks, which run only from the deployment checkout.

  • Counts: check_docs.py passes at 164 Prometheus + 22 Loki rules.

  • After merge: the converge timer deploys it. I'll then read the probe's metrics in Prometheus to settle the units and confirm the table is right.

  • make validate passes

  • Deployed to the lab and confirmed working

  • Docs updated

Refs the 2026-11-13 mjolnir audit.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings November 23, 2026 06:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The alarm tests omit warning status 2, so removing its detection branch could leave the tests passing while warning-level alarms stop firing.

1 open issue
What changed in this PR

Adds SNMP collection and alerting for mjolnir’s AP9335T rack-temperature probe within the observability stack. Live confirmation of the selected table and temperature units remains pending.

Changes:

  • Collects four probe metrics, with sensor-name labels.
  • Adds three alerts and tests for missing probes, communication loss, and card-reported temperature alarms.
  • Records the probe purchase, removes it from the buy list, and updates alert counts.
File Description
stacks/​observability/​snmp-exporter/​snmp.yaml Adds generated probe metrics and table walk.
stacks/​observability/​snmp-exporter/​generator.yaml Configures probe collection and sensor-name lookup.
stacks/​observability/​README.md Updates the Prometheus alert count.
stacks/​observability/​prometheus/​tests/​ups.test.yaml Adds probe alert fixtures.
stacks/​observability/​prometheus/​rules/​ups.rules.yaml Adds three probe-monitoring alerts.
README.md Updates alert totals and outstanding purchases.
docs/​security.md Updates the total alert count.
docs/​runbooks/​deploy-stack.md Updates expected loaded-rule counts.
docs/​roadmap.md Removes the purchased probe from the buy list.
docs/​observability.md Documents probe alerts and updates counts.
docs/​hardware.md Records probe installation and collection configuration.
docs/​changelog.md Adds the dated probe purchase and monitoring entry.

Review effort: Balanced

Gerrrt and others added 3 commits November 23, 2026 14:46
The probe decided on 2026-10-16 is bought and plugged into the card's
universal I/O port, so it leaves the buy table. apc_ups walks
uioSensorStatusTable, and three rules watch it: the table empty while the
card answers, the probe's comms lost, and the card's own alarm. A fixed
temperature limit waits for the first readings to settle the units.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gerrrt
Gerrrt force-pushed the gerrrt/mjolnir-temperature-probe branch from a82d9ad to 6ef91e7 Compare November 23, 2026 14:49
@Gerrrt
Gerrrt merged commit c98058b into main Nov 23, 2026
9 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/mjolnir-temperature-probe branch November 23, 2026 15:00
Gerrrt added a commit that referenced this pull request Nov 23, 2026
…re known

The AP9335T's first reading after #1672 deployed was 22 °C: the card
reports whole degrees in uioSensorStatusTemperatureDegC, not the tenths
PowerNet-MIB describes. RackAmbientTemperatureHigh warns over 30 °C for
fifteen minutes; RackAmbientTemperatureCritical pages over 35 °C, the
top of ASHRAE class A2, for ten. The UPS runbook says what to do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gerrrt added a commit that referenced this pull request Nov 23, 2026
…re known (#1681)

* feat(alerts): fixed limits on the rack's temperature, now the units are known

The AP9335T's first reading after #1672 deployed was 22 °C: the card
reports whole degrees in uioSensorStatusTemperatureDegC, not the tenths
PowerNet-MIB describes. RackAmbientTemperatureHigh warns over 30 °C for
fifteen minutes; RackAmbientTemperatureCritical pages over 35 °C, the
top of ASHRAE class A2, for ten. The UPS runbook says what to do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(alerts): assert the warning is quiet mid-spike, not only after it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

2 participants