Repository navigation
feat(alerts): poll mjolnir's outlet groups, and record the card's last settings - #1713
Merged
Merged
Conversation
…t settings Walk upsOutletGroupStatus and upsOutletGroupConfig (not the control table). UpsOutletGroupOff pages on a group off; LoadShedEnabled and DelayChanged warn on drift from no shedding and 90 s off / 0 s on; UpsOutletGroupsUnread guards the tables. hardware.md and the changelog record the users, the SNMPv3 access list, the clock fix and Saruman's ADR-0107 settings as checked on the box. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Changes are needed because incomplete or missing outlet-group telemetry can evade safety alerts, and the paging documentation overlooks outages that disable monitoring or notifications and require the external Watchdog fallback.
2 open issues
What changed in this PR
This PR adds outlet-group monitoring for mjolnir to the observability stack and records the UPS card’s audited settings.
Changes:
- Adds SNMP status and configuration polling with outlet-group names as labels, excluding the control table.
- Adds four alerts and associated tests for outlet state, load shedding, delay changes, and missing readings.
- Records audit results and updates documentation to reflect 210 alert rules, including 182 in Prometheus.
| File | Description |
|---|---|
| stacks/observability/snmp-exporter/snmp.yaml | Adds generated outlet-group metrics and labels. |
| stacks/observability/snmp-exporter/generator.yaml | Configures table walks and group-name lookups. |
| stacks/observability/README.md | Updates the Prometheus alert count. |
| stacks/observability/prometheus/tests/ups.test.yaml | Adds firing and quiet outlet-alert fixtures. |
| stacks/observability/prometheus/rules/ups.rules.yaml | Adds four outlet monitoring alerts. |
| README.md | Updates overall and Prometheus alert totals. |
| docs/security.md | Updates the documented alert total. |
| docs/runbooks/deploy-stack.md | Updates the expected Rules page count. |
| docs/observability.md | Updates alert and test coverage counts. |
| docs/hardware.md | Records outlet settings, card accounts, access restrictions, and clock correction. |
| docs/changelog.md | Records monitoring additions and audit results. |
Review effort: Balanced
…roups; say group-off pages only for group 2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changed
generator.yaml'sapc_upsmodule now walks the card's outlet-group status and config tables, PowerNet.12.1and.12.2, with the group name as a label. The control table,.12.3, the one that switches groups, is not walked.snmp.yamlis regenerated: 1800 metrics become 1819, and all 7 placeholders survived.ups.rules.yaml.UpsOutletGroupOff, critical: a group has been off or unknown for 5 minutes.UpsOutletGroupLoadShedEnabled, warning: any group has shedding turned on, on time on battery, runtime remaining or overload.UpsOutletGroupDelayChanged, warning: a group's turn-off delay is no longer 90 s, or its turn-on delay no longer 0 s.UpsOutletGroupsUnread, warning: the card answers, but the tables are missing.ups.test.yamlgives each rule a firing case and a quiet case.hardware.mdreplaces the "not read yet" outlet-group paragraph with the values read.Saruman's ADR-0107 settings as the owner checked them on the box.Why
The owner asked for the outlet groups to be watched instead of read by hand, as part of finishing the 2026-11-13 audit of
mjolnir. A load shed on group 1 would cut every host before NUT told any of them to halt, and nothing would have noticed one being turned on.Blast radius
snmp-exporter'sapc_upsmodule gains two table walks. Read first withsnmp-walk.sh, they returned 19 and 43 varbinds. The status walk once took 5.4 s while the card stalled, well inside the 45 s scrape timeout. If the module broke, themjolnirscrape would fail, andup{device="mjolnir"}and the card-silence alerts would say so. One rule pages: a group that is off.secrets/*.sops.yamlVerification
scripts/snmp-walk.sh --device mjolniron.12.1,.12.2and.12.3read all three groups: on, every shed disabled, 90 s off delay, 0 s on delay. These match what the owner read at the card.promtool test rules tests/ups.test.yaml, run in the pinned image: SUCCESS../scripts/lint.shandpython3 scripts/check_docs.pypass.I did not run
make validatelocally; CI runs it. After the deploy I'll check the new series and rules on the live Prometheus.make validatepassesDeployed to the lab and confirmed working
Docs updated (
docs/, service README, ordocs/roadmap.md)🤖 Generated with Claude Code