From c9958db05e5e6c2838c5502729d9cd7d6806d92a Mon Sep 17 00:00:00 2001 From: Garrett Allen <98648590+Gerrrt@users.noreply.github.com> Date: Mon, 23 Nov 2026 05:28:03 +0000 Subject: [PATCH 1/3] feat(ups): read the AP9335T rack-ambient probe on mjolnir's card 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 --- README.md | 6 +- docs/changelog.md | 11 ++ docs/hardware.md | 14 +- docs/observability.md | 8 +- docs/roadmap.md | 1 - docs/runbooks/deploy-stack.md | 2 +- stacks/observability/README.md | 2 +- .../prometheus/rules/ups.rules.yaml | 62 +++++++++ .../prometheus/tests/ups.test.yaml | 122 ++++++++++++++++++ .../snmp-exporter/generator.yaml | 31 +++++ stacks/observability/snmp-exporter/snmp.yaml | 75 +++++++++++ 11 files changed, 320 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 616e16c2d..d4e043537 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ documents for different readers. can't run an agent (firewall, switch, UPS, iLO). One agent config, deployed identically everywhere. [How](docs/architecture.md#observability-data-flow) - **Dashboards and alerting as code.** 8 provisioned dashboards, 156 panels, and - 186 alert rules — 161 metric-based in Prometheus, 25 log-based in Loki — sharing + 189 alert rules — 164 metric-based in Prometheus, 25 log-based in Loki — sharing one Alertmanager routing tree. No dashboard exists only in a database. - **Secrets encrypted in-repo with SOPS + age.** Per-device credentials, decrypted at deploy time into gitignored paths, with `git log` showing which @@ -207,7 +207,7 @@ inbound passes may still reach it. Data flow and the maintained Mermaid topology . ├── stacks/ │ ├── observability/ # the estate's stack on prometheus — ten services -│ │ ├── prometheus/ # config, file_sd targets, 161 alert rules +│ │ ├── prometheus/ # config, file_sd targets, 164 alert rules │ │ ├── alertmanager/ # routing and inhibition │ │ ├── loki/ # single-binary config + 25 LogQL rules │ │ ├── alloy/ # the agent config directory, shipped to every host @@ -413,7 +413,7 @@ is [`docs/changelog.md`](docs/changelog.md), dated and never rewritten. **Every purchase still outstanding is in one place**, the roadmap's [*Everything still to buy*](docs/roadmap.md#everything-still-to-buy): -11 items now, 0 later, and a rule that nothing joins them without a +10 items now, 0 later, and a rule that nothing joins them without a decision. This sentence used to carry the list itself, name three purchases coupled to the UPS work and omit the tier's host entirely, which is how one ProDesk came to be bought for two jobs. It names no current item for the diff --git a/docs/changelog.md b/docs/changelog.md index fd9ae5898..29e9fe73e 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,17 @@ docstring gives: it is a record, not a claim about now. ## 2026-11-23 +- **The UPS card's temperature probe is bought, plugged in, and read.** The + APC AP9335T decided on 2026-10-16 leaves *Everything still to buy*; the + operator reported it in the card's universal I/O port on 2026-11-23. The + `apc_ups` module now walks `uioSensorStatusTable`, where an NMC3 reports a + probe on that port, and three rules watch it: `UpsTemperatureProbeMissing` + if the table comes back empty while the card answers, which is also the + check that the right table was chosen; `UpsTemperatureProbeCommsLost`; and + `RackAmbientTemperatureAlarm` on the card's own alarm. No fixed temperature + limit yet: PowerNet-MIB says the Celsius column is in tenths of a degree, + APC's cards have been seen to report whole degrees there, and the first + readings settle which. - **NUT is watched from its own logs.** The 2026-11-13 audit of `mjolnir` found that nothing watched the shutdown path itself, which is how the driver could stay down until 2026-11-07 with only the generic card-silence diff --git a/docs/hardware.md b/docs/hardware.md index 79fbbf2d5..edd2c58e5 100644 --- a/docs/hardware.md +++ b/docs/hardware.md @@ -182,10 +182,13 @@ and the power-up order in the move runbook's §7, and write them here. under *Before you start*, because shedding on group 1 would cut the PDU before any host is told to halt. -**Two more decisions of 2026-10-16, both on the purchase table.** The UPS's -AP9641 card gets an APC AP9335T temperature probe, for rack ambient at the -bottom where the DL360 and the UPS sit; the SNMP job that already polls the -card picks it up once the generator names it. And the strip gives way to a +**Two more decisions of 2026-10-16.** The UPS's AP9641 card gets an APC +AP9335T temperature probe, for rack ambient at the bottom where the DL360 and +the UPS sit. **It is bought and plugged into the card's universal I/O port**, +recorded 2026-11-23, and the `apc_ups` module walks the card's +`uioSensorStatusTable` for it, so it is read on the SNMP job that already polls +the card; `ups.rules.yaml` raises an alert if that table comes back empty. The +second decision is still on the purchase table: the strip gives way to a **switched, SNMP-managed PDU**, so the four hosts without a BMC (`morpheus`, `trinity`, `gandalf`, `smaug`) can be power-cycled without a walk to the rack. The outlet map above is the strip's and is redrawn when that PDU is placed; @@ -377,6 +380,9 @@ the runbook rather than backed up. the card ([#93](https://github.com/Gerrrt/HomeLab/issues/93)). The card's `upsBasicBatteryLastReplaceDate` still reads `08/15/2026` and wants resetting to the fit date — it is the only record of the pack's age +- APC AP9335T temperature probe on the UPS card's universal I/O port, for rack + ambient at the bottom of the rack. Bought and plugged in by 2026-11-23, read + over the card's SNMP from then - 1U vented rack shelf, 4-post with square-hole mounting — in the 9U frame's U4 from 2026-09-08 and in the 32U rack's U14 since 2026-11-06, carrying the unmanaged switch that feeds `prometheus` and `oracle` diff --git a/docs/observability.md b/docs/observability.md index e8c16e4e4..51ba8a5c6 100644 --- a/docs/observability.md +++ b/docs/observability.md @@ -352,7 +352,7 @@ separates a quiet stream from a stopped one. ## Alerting -186 rules in total: 161 metric-based in `prometheus/rules/`, and 25 log-based in +189 rules in total: 164 metric-based in `prometheus/rules/`, and 25 log-based in `loki/rules/`. ### Log-based (Loki ruler) @@ -535,13 +535,13 @@ argument and for what to do when it exits 1. ### Metric-based (Prometheus) -161 rules across twelve files in `prometheus/rules/`: +164 rules across twelve files in `prometheus/rules/`: | File | Covers | | --- | --- | | `host.rules.yaml` | Instance down, predictive disk fill, memory, load, clock skew and a clock with no time source at all — `HostClockUnsynchronised` reads `node_timex_sync_status`, because the offset reads zero once timesyncd has restored a clock that is wrong but stable, which is how a cleared RTC wrote fourteen minutes of samples three hours in the past and nothing noticed ([#519](https://github.com/Gerrrt/HomeLab/issues/519)) — reboots, and, for the two laptops, whether the shelf is on mains, whether the cell that carries them through a cut is still worth relying on ([#454](https://github.com/Gerrrt/HomeLab/issues/454), and [`runbooks/replace-the-laptop-cell.md`](runbooks/replace-the-laptop-cell.md) for the swap), how hot that cell is, whether its temperature is being measured at all — on 2026-09-19 it was not, on either host — and how many minutes the host has left once the cut arrives ([#532](https://github.com/Gerrrt/HomeLab/issues/532)); whether the wiki's drift check on `oracle` is still running, and still able to read its claims ([#470](https://github.com/Gerrrt/HomeLab/issues/470), [#1531](https://github.com/Gerrrt/HomeLab/issues/1531)); and, for the NAS, whether every ZFS pool is online — `ZpoolNotOnline` reads `node_zfs_zpool_state`, added after `erebor` lost a disk on 2026-09-19 with the exporter hung ahead of it and `InstanceDown` the only page ([#558](https://github.com/Gerrrt/HomeLab/issues/558), [`runbooks/replace-the-nas-disk.md`](runbooks/replace-the-nas-disk.md)); and whether any drive's unsafe-shutdown count has grown in a day — `SmartDriveUnsafeShutdownsGrowing`, whose page says when `smaug` recorded a clean power-off the same day, because mains removed after a clean shutdown ticks the S3520 and a clean shutdown alone does not ([#746](https://github.com/Gerrrt/HomeLab/issues/746)), the measure of a cut the shutdown sequence [ADR-0049](adr/0049-shut-down-on-the-ups-from-a-nut-server-on-the-firewall.md) decides did not catch, the rule [ADR-0047](adr/0047-collect-smaug-smart-through-a-root-cron-and-the-textfile-collector.md) left to that issue when it carried `smaug`'s counter under the scrape ([#574](https://github.com/Gerrrt/HomeLab/issues/574)); and, for `Saruman`, how full its LVM-thin pools are — which `node_filesystem_*` cannot see — and whether its Proxmox firewall is still on with an inbound policy that drops, from two agent collectors ([#538](https://github.com/Gerrrt/HomeLab/issues/538), [#576](https://github.com/Gerrrt/HomeLab/issues/576)); and whether the `tc` mirror that feeds Zeek on `fenrir` is still delivering packets from every port of the lab bridge — `ZeekMirrorInactive`, Zeek's absence detection answered on the hypervisor because the lab's Loki has no ruler ([#437](https://github.com/Gerrrt/HomeLab/issues/437), [ADR-0068](adr/0068-mirror-the-lab-bridge-to-zeek-with-tc-not-open-vswitch.md)); and whether a guest the hypervisor tags `disposable` has outlived the fortnight it was built for — `DisposableGuestOutlived`, read from each guest's own `qm config` rather than from any list of which guests should exist, which is also why `HypervisorGuestStopped` stays quiet for such a guest, with `GuestConfigUnreadable` covering the read itself failing ([#438](https://github.com/Gerrrt/HomeLab/issues/438), [ADR-0071](adr/0071-run-disposable-investigations-on-a-guest-that-is-destroyed.md)); and a guest tagged `backup` that no enabled backup job selects, as `GuestNotInBackupJob`, after the domain's six fell out of `golem-nightly` through purged tofu destroys (2026-10-10); and how many days the four management consoles' certificates have left — the pfSense GUI, the iLO, `Saruman`'s `:8006` and the TrueNAS UI, none of which the blackbox exporter can reach — `ManagementCertificateExpiringSoon` at 30 days and `ManagementCertificateExpiryImminent` at 7, read from a handshake made inside each console's own segment, with `ManagementCertificateUnchecked` for a console that would not answer and `CertExpiryStateStale` for a collector that stopped ([#857](https://github.com/Gerrrt/HomeLab/issues/857), [ADR-0084](adr/0084-read-management-certificate-expiry-from-inside-each-segment.md)) | | `network.rules.yaml` | SNMP reachability, pf not running, state table, switch links, a switch port whose VLAN changed (`SwitchPortVlanChanged`, from `dot1qPvid`, [#1387](https://github.com/Gerrrt/HomeLab/issues/1387)), iLO hardware and Smart Array cache. `shiva`'s Smart Storage Battery read failed from 2026-08-18 until it was replaced on 2026-09-02, with the array in write-through as a result, so stored metrics before that date show the failed pack — `IloBatteryCondition` names the spare part to order, and the controller rollups are deliberately read at *failed* rather than *degraded* ([#76](https://github.com/Gerrrt/HomeLab/issues/76)). Also whether the remote path's dynamic DNS name still resolves to the WAN address — `DdnsRecordStale` and `DdnsRecordUnchecked`, from the comparison `scripts/collect-gateway-state.sh` makes on the firewall every fifteen minutes ([#604](https://github.com/Gerrrt/HomeLab/issues/604), [ADR-0044](adr/0044-answer-the-endpoint-with-dynamic-dns-from-morpheus.md)); see *What the dynamic DNS series disclose* below | -| `ups.rules.yaml` | On battery, low battery, runtime, load, temperature, and whether the shutdown order has time to run: `UpsLowBatteryDurationShort` when the card's low-battery duration is under the 16 minutes [ADR-0107](adr/0107-subscribe-trinity-to-the-ups-and-bound-saruman-s-guest-stop.md) needs, `UpsRideThroughShort` when a charged pack on mains would start the halt under 15 minutes into a cut. A pack was fitted on 2026-08-28 and passed its self-test, so these read real hardware; stored metrics older than that date are the card's fabricated values — see [`runbooks/fit-the-ups-battery.md`](runbooks/fit-the-ups-battery.md) | +| `ups.rules.yaml` | On battery, low battery, runtime, load, temperature, and whether the shutdown order has time to run: `UpsLowBatteryDurationShort` when the card's low-battery duration is under the 16 minutes [ADR-0107](adr/0107-subscribe-trinity-to-the-ups-and-bound-saruman-s-guest-stop.md) needs, `UpsRideThroughShort` when a charged pack on mains would start the halt under 15 minutes into a cut. Three rules read the AP9335T rack-ambient probe on the card: `UpsTemperatureProbeMissing`, `UpsTemperatureProbeCommsLost` and `RackAmbientTemperatureAlarm`, which carries the card's own limits until the first readings settle the column's units. A pack was fitted on 2026-08-28 and passed its self-test, so these read real hardware; stored metrics older than that date are the card's fabricated values — see [`runbooks/fit-the-ups-battery.md`](runbooks/fit-the-ups-battery.md) | | `containers.rules.yaml` | Restart loops, OOM kills, memory, throttling | | `stack.rules.yaml` | The stack watching itself: config reloads, rule evaluation, notification delivery, log ingestion, and the two cases `up == 0` structurally cannot see — a remote-writing agent that stops pushing, and a scraped target that stops being a target at all. The second is `ScrapeTargetDisappeared`, added with the first scraped host ([#256](https://github.com/Gerrrt/HomeLab/issues/256)): an emptied or unparseable `targets/node.yaml` makes the series vanish rather than fall to 0, so `InstanceDown` stays silent and `RemoteWriteJobStale` excludes scraped jobs by design. `AlloyDown` (2026-10-07) is the one alert per host for the agent itself stopping. It keys on the `-alloy` self-scrape and fires five minutes before `RemoteWriteJobStale` would, and an inhibit rule in `alertmanager.yaml` then holds back that host's per-job alerts. The target for `smaug` was written into `targets/node.yaml` disabled on 2026-09-17 and enabled on 2026-09-19, once the exporter answered from the pool. Split off `containers.rules.yaml` onto `component: stack` in [#81](https://github.com/Gerrrt/HomeLab/issues/81) so a Prometheus that cannot reload its config stops being filed as a container fault. Since [#575](https://github.com/Gerrrt/HomeLab/issues/575) also whether an Alertmanager silence is about to lapse or names no owning issue, read from the per-silence series `scripts/collect_silences.py` writes every fifteen minutes — `alertmanager_silences` is a count per state and cannot say which alert, when, or whose | | `watchdog.rules.yaml` | One rule that always fires, so that its absence is detectable | @@ -571,7 +571,7 @@ as loaded and healthy and could not fire for any input ([#63](https://github.com `prometheus/tests/*.test.yaml` holds `promtool test rules` unit tests, which feed a rule synthetic series and assert it fires — paired with a case asserting it stays quiet, because a test that only ever expects silence would have passed -against the broken rule too. Coverage is 161 rules of 161 so far ([#843](https://github.com/Gerrrt/HomeLab/issues/843)) — all twelve +against the broken rule too. Coverage is 164 rules of 164 so far ([#843](https://github.com/Gerrrt/HomeLab/issues/843)) — all twelve in `blackbox.rules.yaml`, all three in `dns.rules.yaml`, `GatewayFilesystemCritical`, `ContainerHighMemory`, `ContainerNearMemoryLimit`, `ContainerRestartLoop`, `ContainerCpuThrottled`, the three container-state rules from diff --git a/docs/roadmap.md b/docs/roadmap.md index 349a96267..64ba7e968 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -171,7 +171,6 @@ move and stay until they are bought or dropped. | Item | For | Decided by | When it is needed | | --- | --- | --- | --- | -| APC AP9335T temperature probe, for the UPS's AP9641 card | Rack ambient at U1–U2, where the heavy iron is; the existing SNMP job polls the card, so a generator change follows the purchase | The operator, 2026-10-16 | Any time | | Switched, SNMP-managed 1U PDU, eight outlets or more: APC AP7900B class | Remote power-cycling for the four hosts without a BMC: `morpheus`, `trinity`, `gandalf`, `smaug`. It replaces the strip at U4; the screen's brick and the KVM move to the UPS's own outlets, so eight outlets suffice | The operator, 2026-10-16. **Its segment and hardening are an ADR before it is cabled**, as [ADR-0036](adr/0036-poll-the-ilo-and-the-ups-card-over-snmpv3-and-keep-the-firewall-on-bsnmpd.md) was for the iLO and the UPS card | Now that the #919 move is done: a management-plane device, not a move part | | USB-to-RJ45 serial console cable | The CRS326's console port: the way back in when its UI is unreachable, which is the swap runbook's rollback case | The operator, 2026-10-16 | Any time; the #919 move is done | | Label maker with flag tape, or self-laminating wrap labels | Both ends of every lead, and the panel and switch ports: the physical half of the port map the swap runbook captures | The operator, 2026-10-16 | Any time; the #919 move is done | diff --git a/docs/runbooks/deploy-stack.md b/docs/runbooks/deploy-stack.md index 9df5cb21f..adc8343e1 100644 --- a/docs/runbooks/deploy-stack.md +++ b/docs/runbooks/deploy-stack.md @@ -151,7 +151,7 @@ Then in the UI: 1. **Prometheus → Status → Targets.** Every job `UP`. The four `snmp` targets take up to 45 seconds on their first scrape. 2. **Prometheus → Status → Rules.** Every rule loaded, none in error. The - page lists 167: the 161 alert rules this repository counts everywhere + page lists 170: the 164 alert rules this repository counts everywhere else, plus the six recording rules: `homelab_suricata_expected_interface`, `homelab_battery_runtime_seconds`, and the two directions each of diff --git a/stacks/observability/README.md b/stacks/observability/README.md index 172f125cb..99dd69351 100644 --- a/stacks/observability/README.md +++ b/stacks/observability/README.md @@ -53,7 +53,7 @@ prometheus/ targets/snmp.yaml SNMP targets — hot-reloaded, no restart needed targets/node.yaml node_exporter scrapes, for the host that runs no Alloy (smaug) targets/blackbox*.yaml probe targets, http, dns and latency — hot-reloaded, no restart - rules/*.rules.yaml 161 alert rules: host, network, ups, containers, blackbox, + rules/*.rules.yaml 164 alert rules: host, network, ups, containers, blackbox, dns, backup, ids, deploy, stack, internet and watchdog tests/*.test.yaml promtool unit tests — assert the rules can fire blackbox/blackbox.yaml probe modules — reachability, and what a resolver said diff --git a/stacks/observability/prometheus/rules/ups.rules.yaml b/stacks/observability/prometheus/rules/ups.rules.yaml index 615ead237..2f3a80cf5 100644 --- a/stacks/observability/prometheus/rules/ups.rules.yaml +++ b/stacks/observability/prometheus/rules/ups.rules.yaml @@ -410,3 +410,65 @@ groups: has aged, or the low battery duration was raised. Read upsOutputPercentLoad and upsEstimatedMinutesRemaining on the UPS & Power dashboard before changing anything. + + # --- The AP9335T temperature probe on the card's universal I/O port ---- + # + # Rack ambient at the bottom of the rack, where the DL360 and the UPS + # sit (decided 2026-10-16, plugged in by 2026-11-23). generator.yaml says + # which table the card reports it in, and why that is a reading to + # confirm, not a certainty: UpsTemperatureProbeMissing is that check. + # + # NO STATIC TEMPERATURE THRESHOLD YET. PowerNet-MIB describes + # uioSensorStatusTemperatureDegC as tenths of a degree, and APC's cards + # are known to report whole degrees in that column. A fixed limit is + # added once the first readings settle which it is. Until then the + # card's own alarm status carries the threshold, so set the probe's + # high-temperature limits at the card. + - alert: UpsTemperatureProbeMissing + expr: | + up{job="snmp", device="mjolnir"} == 1 + unless on(device) uioSensorStatusCommStatus{device="mjolnir"} + for: 30m + labels: + component: power + severity: warning + category: power + annotations: + summary: "{{ $labels.device }} answers SNMP but reports no temperature probe" + description: >- + The card answers, and uioSensorStatusTable has no row. Either the + AP9335T is unplugged from the card's universal I/O port, or this + card reports it in a table generator.yaml does not walk. Check the + probe at the card's web interface before changing the generator. + + - alert: UpsTemperatureProbeCommsLost + # commsOK is 2. notInstalled (1) and commsLost (3) both mean no reading. + expr: uioSensorStatusCommStatus{device="mjolnir"} != 2 + for: 15m + labels: + component: power + severity: warning + category: power + annotations: + summary: "The temperature probe on {{ $labels.device }} is not talking to the card" + description: >- + uioSensorStatusCommStatus reads {{ $value }} (1 not installed, + 3 communication lost) on port {{ $labels.uioSensorStatusPortID }}. + Rack ambient is unmeasured until the probe's lead is reseated. + + - alert: RackAmbientTemperatureAlarm + # uioWarning is 2 and uioCritical 3, against the limits set on the card. + expr: uioSensorStatusAlarmStatus{device="mjolnir"} == 2 or uioSensorStatusAlarmStatus{device="mjolnir"} == 3 + for: 10m + labels: + component: power + severity: warning + category: power + annotations: + summary: "Rack ambient at {{ $labels.device }}'s probe is past the card's limit" + description: >- + The card raises its own alarm for probe + {{ $labels.uioSensorStatusSensorName }}: status {{ $value }} + (2 warning, 3 critical). Read uioSensorStatusTemperatureDegC and + the DL360's inlet temperature before anything else; the probe sits + at the bottom of the rack, where the heavy iron is. diff --git a/stacks/observability/prometheus/tests/ups.test.yaml b/stacks/observability/prometheus/tests/ups.test.yaml index c84767b09..8dbd062c2 100644 --- a/stacks/observability/prometheus/tests/ups.test.yaml +++ b/stacks/observability/prometheus/tests/ups.test.yaml @@ -559,3 +559,125 @@ tests: - eval_time: 45m alertname: UpsRideThroughShort exp_alerts: [] + + # --- The temperature probe ------------------------------------------------- + # The production shape once the probe reports: card up, probe talking, no + # alarm. Every probe rule must be quiet. + - interval: 1m + input_series: + - series: 'up{device="mjolnir",instance="10.0.99.10",job="snmp"}' + values: "1x60" + - series: >- + uioSensorStatusCommStatus{device="mjolnir",instance="10.0.99.10",job="snmp", + uioSensorStatusPortID="1",uioSensorStatusSensorID="1", + uioSensorStatusSensorName="Port 1 Temp 1"} + values: "2x60" + - series: >- + uioSensorStatusAlarmStatus{device="mjolnir",instance="10.0.99.10",job="snmp", + uioSensorStatusPortID="1",uioSensorStatusSensorID="1", + uioSensorStatusSensorName="Port 1 Temp 1"} + values: "1x60" + alert_rule_test: + - eval_time: 45m + alertname: UpsTemperatureProbeMissing + exp_alerts: [] + - eval_time: 45m + alertname: UpsTemperatureProbeCommsLost + exp_alerts: [] + - eval_time: 45m + alertname: RackAmbientTemperatureAlarm + exp_alerts: [] + + # The card answers and the table is empty: the probe is missing. + - interval: 1m + input_series: + - series: 'up{device="mjolnir",instance="10.0.99.10",job="snmp"}' + values: "1x60" + alert_rule_test: + - eval_time: 45m + alertname: UpsTemperatureProbeMissing + exp_alerts: + - exp_labels: + component: power + severity: warning + category: power + device: mjolnir + instance: 10.0.99.10 + job: snmp + exp_annotations: + summary: "mjolnir answers SNMP but reports no temperature probe" + description: >- + The card answers, and uioSensorStatusTable has no row. Either the + AP9335T is unplugged from the card's universal I/O port, or this + card reports it in a table generator.yaml does not walk. Check the + probe at the card's web interface before changing the generator. + + # The card is down: the generic card-silence alerts own that, not this one. + - interval: 1m + input_series: + - series: 'up{device="mjolnir",instance="10.0.99.10",job="snmp"}' + values: "0x60" + alert_rule_test: + - eval_time: 45m + alertname: UpsTemperatureProbeMissing + exp_alerts: [] + + # The probe's lead is out: commsLost (3). + - interval: 1m + input_series: + - series: >- + uioSensorStatusCommStatus{device="mjolnir",instance="10.0.99.10",job="snmp", + uioSensorStatusPortID="1",uioSensorStatusSensorID="1", + uioSensorStatusSensorName="Port 1 Temp 1"} + values: "3x60" + alert_rule_test: + - eval_time: 30m + alertname: UpsTemperatureProbeCommsLost + exp_alerts: + - exp_labels: + component: power + severity: warning + category: power + device: mjolnir + instance: 10.0.99.10 + job: snmp + uioSensorStatusPortID: "1" + uioSensorStatusSensorID: "1" + uioSensorStatusSensorName: Port 1 Temp 1 + exp_annotations: + summary: "The temperature probe on mjolnir is not talking to the card" + description: >- + uioSensorStatusCommStatus reads 3 (1 not installed, + 3 communication lost) on port 1. + Rack ambient is unmeasured until the probe's lead is reseated. + + # The card's own limit is crossed: uioCritical (3). + - interval: 1m + input_series: + - series: >- + uioSensorStatusAlarmStatus{device="mjolnir",instance="10.0.99.10",job="snmp", + uioSensorStatusPortID="1",uioSensorStatusSensorID="1", + uioSensorStatusSensorName="Port 1 Temp 1"} + values: "3x60" + alert_rule_test: + - eval_time: 30m + alertname: RackAmbientTemperatureAlarm + exp_alerts: + - exp_labels: + component: power + severity: warning + category: power + device: mjolnir + instance: 10.0.99.10 + job: snmp + uioSensorStatusPortID: "1" + uioSensorStatusSensorID: "1" + uioSensorStatusSensorName: Port 1 Temp 1 + exp_annotations: + summary: "Rack ambient at mjolnir's probe is past the card's limit" + description: >- + The card raises its own alarm for probe + Port 1 Temp 1: status 3 + (2 warning, 3 critical). Read uioSensorStatusTemperatureDegC and + the DL360's inlet temperature before anything else; the probe sits + at the bottom of the rack, where the heavy iron is. diff --git a/stacks/observability/snmp-exporter/generator.yaml b/stacks/observability/snmp-exporter/generator.yaml index 0b6fb5dd7..11af50d1e 100644 --- a/stacks/observability/snmp-exporter/generator.yaml +++ b/stacks/observability/snmp-exporter/generator.yaml @@ -132,6 +132,37 @@ modules: # out of range, and a rule built on that would be wrong about the one # value the card actually holds. - 1.3.6.1.4.1.318.1.1.1.7.2 # PowerNet-MIB::upsAdvTest (diagnostics) + # The AP9335T temperature probe on the card's universal I/O port, for rack + # ambient at the bottom of the rack (decided 2026-10-16, plugged in by + # 2026-11-23). An NMC3 reports a probe on that port in uioSensorStatusTable, + # one row per sensor, indexed by port and sensor; the older iemStatusProbes + # table is the integrated environmental monitor of earlier cards, and is + # not walked. Columns: .5 degrees F, .6 degrees C, .7 humidity (-1 on a + # temperature-only probe), .8 the card's threshold violation, .9 its alarm + # status (uioNormal 1, uioWarning 2, uioCritical 3), .10 the probe's + # communication with the card (notInstalled 1, commsOK 2, commsLost 3). + # UpsTemperatureProbeMissing in ups.rules.yaml fires if this table comes + # back empty while the card answers, which is how a wrong guess about + # which table the card uses would show itself. + - 1.3.6.1.4.1.318.1.1.25.1.2 # PowerNet-MIB::uioSensorStatusTable + lookups: + - source_indexes: [uioSensorStatusPortID, uioSensorStatusSensorID] + lookup: uioSensorStatusSensorName + overrides: + # The two index columns repeat the labels every row already carries. + uioSensorStatusPortID: + ignore: true + uioSensorStatusSensorID: + ignore: true + uioSensorStatusSensorName: + ignore: true + type: DisplayString + uioSensorStatusSensorLocation: + ignore: true + uioSensorStatusTemperatureDegF: + ignore: true + uioSensorStatusHumidity: + ignore: true # pfSense (morpheus, 10.0.99.1) — BEGEMOT-PF-MIB, plus one HOST-RESOURCES # table. Packet filter counters, state table usage, per-interface pf diff --git a/stacks/observability/snmp-exporter/snmp.yaml b/stacks/observability/snmp-exporter/snmp.yaml index a40357d63..004fda979 100644 --- a/stacks/observability/snmp-exporter/snmp.yaml +++ b/stacks/observability/snmp-exporter/snmp.yaml @@ -35,6 +35,7 @@ modules: walk: - 1.3.6.1.2.1.33.1 - 1.3.6.1.4.1.318.1.1.1.7.2 + - 1.3.6.1.4.1.318.1.1.25.1.2 metrics: - name: upsIdentManufacturer oid: 1.3.6.1.2.1.33.1.1.1 @@ -462,6 +463,80 @@ modules: 5: friday 6: saturday 7: sunday + - name: uioSensorStatusTemperatureDegC + oid: 1.3.6.1.4.1.318.1.1.25.1.2.1.6 + type: gauge + help: The sensor's current temperature reading in tenths of degrees Celsius. + - 1.3.6.1.4.1.318.1.1.25.1.2.1.6 + indexes: + - labelname: uioSensorStatusPortID + type: gauge + - labelname: uioSensorStatusSensorID + type: gauge + lookups: + - labels: + - uioSensorStatusPortID + - uioSensorStatusSensorID + labelname: uioSensorStatusSensorName + oid: 1.3.6.1.4.1.318.1.1.25.1.2.1.3 + type: DisplayString + - name: uioSensorStatusViolationStatus + oid: 1.3.6.1.4.1.318.1.1.25.1.2.1.8 + type: gauge + help: The violation status of the sensor - 1.3.6.1.4.1.318.1.1.25.1.2.1.8 + indexes: + - labelname: uioSensorStatusPortID + type: gauge + - labelname: uioSensorStatusSensorID + type: gauge + lookups: + - labels: + - uioSensorStatusPortID + - uioSensorStatusSensorID + labelname: uioSensorStatusSensorName + oid: 1.3.6.1.4.1.318.1.1.25.1.2.1.3 + type: DisplayString + - name: uioSensorStatusAlarmStatus + oid: 1.3.6.1.4.1.318.1.1.25.1.2.1.9 + type: gauge + help: The alarm status of the sensor. - 1.3.6.1.4.1.318.1.1.25.1.2.1.9 + indexes: + - labelname: uioSensorStatusPortID + type: gauge + - labelname: uioSensorStatusSensorID + type: gauge + lookups: + - labels: + - uioSensorStatusPortID + - uioSensorStatusSensorID + labelname: uioSensorStatusSensorName + oid: 1.3.6.1.4.1.318.1.1.25.1.2.1.3 + type: DisplayString + enum_values: + 1: uioNormal + 2: uioWarning + 3: uioCritical + 4: sensorStatusNotApplicable + - name: uioSensorStatusCommStatus + oid: 1.3.6.1.4.1.318.1.1.25.1.2.1.10 + type: gauge + help: The communications status of the sensor. - 1.3.6.1.4.1.318.1.1.25.1.2.1.10 + indexes: + - labelname: uioSensorStatusPortID + type: gauge + - labelname: uioSensorStatusSensorID + type: gauge + lookups: + - labels: + - uioSensorStatusPortID + - uioSensorStatusSensorID + labelname: uioSensorStatusSensorName + oid: 1.3.6.1.4.1.318.1.1.25.1.2.1.3 + type: DisplayString + enum_values: + 1: notInstalled + 2: commsOK + 3: commsLost crs326: walk: - 1.3.6.1.2.1.17.1.4.1.2 From 067baf633a065635e6b60878328c94ae7db44936 Mon Sep 17 00:00:00 2001 From: Garrett Allen <98648590+Gerrrt@users.noreply.github.com> Date: Mon, 23 Nov 2026 14:36:50 +0000 Subject: [PATCH 2/3] test(alerts): cover the probe's warning alarm status, not only critical Co-Authored-By: Claude Opus 5.5 --- .../prometheus/tests/ups.test.yaml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/stacks/observability/prometheus/tests/ups.test.yaml b/stacks/observability/prometheus/tests/ups.test.yaml index 8dbd062c2..7e2d717ba 100644 --- a/stacks/observability/prometheus/tests/ups.test.yaml +++ b/stacks/observability/prometheus/tests/ups.test.yaml @@ -681,3 +681,34 @@ tests: (2 warning, 3 critical). Read uioSensorStatusTemperatureDegC and the DL360's inlet temperature before anything else; the probe sits at the bottom of the rack, where the heavy iron is. + + # The warning limit counts too: uioWarning (2). + - interval: 1m + input_series: + - series: >- + uioSensorStatusAlarmStatus{device="mjolnir",instance="10.0.99.10",job="snmp", + uioSensorStatusPortID="1",uioSensorStatusSensorID="1", + uioSensorStatusSensorName="Port 1 Temp 1"} + values: "2x60" + alert_rule_test: + - eval_time: 30m + alertname: RackAmbientTemperatureAlarm + exp_alerts: + - exp_labels: + component: power + severity: warning + category: power + device: mjolnir + instance: 10.0.99.10 + job: snmp + uioSensorStatusPortID: "1" + uioSensorStatusSensorID: "1" + uioSensorStatusSensorName: Port 1 Temp 1 + exp_annotations: + summary: "Rack ambient at mjolnir's probe is past the card's limit" + description: >- + The card raises its own alarm for probe + Port 1 Temp 1: status 2 + (2 warning, 3 critical). Read uioSensorStatusTemperatureDegC and + the DL360's inlet temperature before anything else; the probe sits + at the bottom of the rack, where the heavy iron is. From 6ef91e798b33fc840bd885cc7cc685f4ac037d36 Mon Sep 17 00:00:00 2001 From: Garrett Allen <98648590+Gerrrt@users.noreply.github.com> Date: Mon, 23 Nov 2026 14:49:15 +0000 Subject: [PATCH 3/3] docs(security): count 189 alert rules after the NUT rules landed Co-Authored-By: Claude Opus 5.5 --- docs/security.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/security.md b/docs/security.md index 38b2c2e98..64c8c401b 100644 --- a/docs/security.md +++ b/docs/security.md @@ -33,7 +33,7 @@ What this network is actually built to survive: | A rooted range target reaching `gandalf` itself | **Dropped at `vmbr1`, before the host firewall, once applied.** The host has no address on the range bridge, but Linux answers ARP for its addresses on any interface and accepts a packet for them on any interface. So a target that adds an on-link route to `10.0.30.30` was reaching the host, and only the Proxmox firewall dropped it. Nothing watches that firewall on `gandalf`. A netdev `ingress` table on `vmbr1` now drops every frame the bridge passes up to the host, ARP included, without touching guest-to-guest traffic ([`build-the-playground.md`](runbooks/build-the-playground.md) §2, proved by §8 check four). Behind it, `gandalf` holds no estate credential, no GitHub login, no personal tooling and no third-party apt repository (§4, *Nothing else on `gandalf`*), so the host gives nothing beyond itself. The audits of 2026-11-13 and 2026-11-22 found credentials, then tooling and two third-party repositories. The credentials were gone by 2026-11-22. **The table and the tooling removal are not yet applied** | | Someone on Winterfell or Hicks logging in to `trinity` | **Key-only `sshd` since 2026-11-20; no host firewall by decision.** `trinity` holds the household's data and the sensitive tier's age key, and its `sshd` answers Hicks (by [ADR-0031](adr/0031-narrow-hicks-to-a-named-list-on-winterfell-and-leave-the-lab-open.md)'s list) and every host on VLAN 99, between which pfSense never filters. [`build-the-sensitive-tier-host.md`](runbooks/build-the-sensitive-tier-host.md) §3 now makes `sshd` key-only through a drop-in that outranks cloud-init's, refuses root and X11 forwarding, and keeps `authorized_keys` to `prometheus`'s key and Hicks's. The audit of 2026-11-13 found it taking passwords, with X11 forwarding on and 17 keys imported from GitHub. The step was applied on 2026-11-20: a password-only login is refused with `Permission denied (publickey)`, and three keys remain, `prometheus`'s, Hicks's and the operator's laptop, the last kept by decision. Agent sessions run on `trinity` as the operator, by decision ([ADR-0123](adr/0123-keep-agent-sessions-on-trinity.md)). `ufw` is installed and stays disabled, unlike `phoenix`'s ([ADR-0117](adr/0117-give-phoenix-a-key-only-sshd-and-a-default-deny-inbound-policy.md)): the other two ports `trinity` answers, `443` and `53`, are published by Docker, whose rules run ahead of `ufw`'s, so a policy would govern `22` alone, which the drop-in already closes to anything without a key. Nothing routes through `trinity`, and as the spare firewall a host policy is one more thing to get in the way the day it stands in for `morpheus`. What reaches `443` and `53` is set by pfSense and by the stack's bind addresses | | Someone with the trusted Wi-Fi key quietly joining | Kea's lease log reaches Loki; `UnknownDeviceOnTrustedSegment` fires the first time a MAC appears on VLAN 50 in seven days ([ADR-0019](adr/0019-read-device-joins-from-the-dhcp-server.md)) | -| Losing visibility of a failure | 186 alert rules, 30 days of metrics and logs | +| Losing visibility of a failure | 189 alert rules, 30 days of metrics and logs | | Someone on a reachable VLAN silencing an alert to hide a failure | Alertmanager binds to `127.0.0.1`; silences go through authenticated Grafana | | Mains power loss | **The rack, yes; the monitoring path, yes — on two laptop cells that were measured for the first time on 2026-09-12.** A pack fitted to `mjolnir` on 2026-08-28 passed its self-test; the TP-Link carrying `prometheus` and `oracle` has been on UPS power since 2026-09-08 ([#110](https://github.com/Gerrrt/HomeLab/issues/110)); the laptops ride a cut out on their own batteries, which `HostBatteryHealthLow` in `host.rules.yaml` now reads — `prometheus`'s cell was replaced on 2026-09-18 and reads 101 % of design, `oracle`'s was replaced on 2026-09-29 and reads 100 %, its design figure rather than a learned one ([#531](https://github.com/Gerrrt/HomeLab/issues/531)) — and **each runtime was measured once: `prometheus`'s on 2026-09-19, about 2.5 hours from full at the stack's load, and `oracle`'s on 2026-09-29, about 5.2 hours**; since the same day the projection is recorded on every cut and pages under thirty minutes (`HostBatteryRuntimeLow`, [#532](https://github.com/Gerrrt/HomeLab/issues/532)), but neither pack reports a moving cell temperature, so this row is answered for both hosts' runtime and for neither's cell temperature — see below. **What happens when the cut outlasts the pack is configured and accepted without a live test.** Since 2026-09-23 the firewall's NUT server reads `mjolnir`, and `Saruman` and `smaug` subscribe to it on their own gateway addresses, so a real cut would now try to run the sequence [ADR-0049](adr/0049-shut-down-on-the-ups-from-a-nut-server-on-the-firewall.md) decides: `Saruman` and `smaug` halt first and `morpheus` last. Since the move into the 32U rack on 2026-11-06 the PDU also carries `trinity`, `gandalf` (off until its build) and the console, with `smaug` racked and on the PDU directly rather than by its old long cord to the media room. [ADR-0107](adr/0107-subscribe-trinity-to-the-ups-and-bound-saruman-s-guest-stop.md) makes `trinity` a third subscriber and bounds `Saruman`'s guest stop. `Saruman`'s half was applied on 2026-11-13 (`down=90` on the four ordered guests, and its monitor stays logged in until they are down); `trinity`'s subscription, `HOSTSYNC 600` on `morpheus` and the card's 16-minute threshold followed on 2026-11-20, so all three subscribers would now halt before the pack empties; `gandalf`, the console and `neo` are left to the pack by decision. The pack itself is unmeasured: about 47 minutes at 21 % load is the card's own estimate. Neither the forced-shutdown proof nor a mains pull will be run ([ADR-0121](adr/0121-accept-the-ups-shutdown-without-a-live-test.md)) | | The estate being down while the person who runs it is unavailable | **Documentation, yes; data, no copy outside the house, by decision.** ADR-0011 puts the emergency tier on paper; [ADR-0023](adr/0023-keep-the-household-recovery-path-outside-the-estate.md) extends the same reasoning to the sensitive tier's data. That tier has held real photographs since 2026-09-28. [ADR-0122](adr/0122-drop-the-household-copy.md) dropped their copy outside the estate, so a loss of the house loses them — see below |