Repository navigation
feat(alerts): watch mjolnir's pack age and input sensitivity - #1709
Merged
Merged
Conversation
Read upsBasicBatteryLastReplaceDate (split into Year and Month by regex) and upsAdvConfigSensitivity off the card. UpsBatteryPackAging warns at three years, UpsInputSensitivityChanged when it leaves medium, and UpsCardReadingMissing if either reading disappears. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The alert’s diagnostic command is unusable because it passes two readings to a script that accepts one numeric OID and includes an invalid OID; both the annotation and its expected test value need correction.
1 open issue
What changed in this PR
This PR extends the existing SNMP and Prometheus monitoring for mjolnir to track battery-pack age and detect changes to input sensitivity.
Changes:
- Adds battery-replacement date extraction and input-sensitivity collection.
- Adds three warning rules for pack age, sensitivity changes, and missing readings, with firing and quiet test cases.
- Updates operational documentation and alert counts to 206 total, including 178 Prometheus alerts.
| File | Description |
|---|---|
stacks/observability/snmp-exporter/snmp.yaml |
Adds generated scalar GETs and metric definitions. |
stacks/observability/snmp-exporter/generator.yaml |
Configures new readings and year/month extraction. |
stacks/observability/README.md |
Updates the Prometheus alert count. |
stacks/observability/prometheus/tests/ups.test.yaml |
Adds firing and quiet cases for all three warnings. |
stacks/observability/prometheus/rules/ups.rules.yaml |
Defines pack-age, sensitivity-change, and missing-reading alerts. |
README.md |
Updates overall and Prometheus alert totals. |
docs/security.md |
Updates the monitoring coverage count. |
docs/runbooks/fit-the-ups-battery.md |
Connects setting the replacement date to clearing the age warning. |
docs/runbooks/deploy-stack.md |
Updates the expected Rules page count. |
docs/observability.md |
Updates alert totals and documented test coverage. |
docs/hardware.md |
Documents the new UPS warnings and pack-age threshold. |
docs/changelog.md |
Records the monitoring additions and verification. |
Review effort: Balanced
…sitivity # Conflicts: # docs/changelog.md
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
Prometheus now reads two more values off
mjolnir's card, and three new warnings watch them:UpsBatteryPackAgingwarns when the pack is three years old, by the card's Last Battery Replacement date. The card stores that date as a month and year.generator.yamlsplitsupsBasicBatteryLastReplaceDateinto...Yearand...Monthwith a regex. The current pack reaches three years in August 2029.UpsInputSensitivityChangedwarns whenupsAdvConfigSensitivityhas been anything but medium (3) for 30 minutes.UpsCardReadingMissingwarns when the card answers SNMP but either reading is absent, so the two rules above can't sit quietly on nothing.The other changes:
snmp.yamlis regenerated withmake snmp-generate. The metric count went from 1798 to 1800, and all 7 placeholders survived.ups.test.yamlgives each new rule a firing case and a quiet case.hardware.md,fit-the-ups-battery.mdstep 5 and the changelog are updated.Why
The owner asked for both after the 2026-11-13 audit of
mjolnir. Nothing reminded anyone of the pack's age. Nothing would notice if sensitivity went back to high, which a card reset would do without a word. Medium was set on 2026-11-24, after three transfers to battery in a month for distorted input.Blast radius
The change touches
snmp-exporter'sapc_upsmodule, adding two GETs to the card's scrape. A broken module would fail themjolnirscrape, andup{device="mjolnir"}and the card-silence alerts would say so. The three new rules are warnings only.secrets/*.sops.yamlVerification
Both OIDs were read off the card first with
scripts/snmp-walk.sh --device mjolnir..2.1.3.0returned"08/15/2026"and.5.2.7.0returned3.promtool test rules tests/ups.test.yaml, run in the pinned image, reports SUCCESS.python3 scripts/check_docs.pyand./scripts/lint.shpass.I did not run
make validatelocally; CI runs it. After the deploy I'll check the three new series and the 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