Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
206 alert rules — 178 metric-based in Prometheus, 28 log-based in Loki — sharing
210 alert rules — 182 metric-based in Prometheus, 28 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
Expand Down Expand Up @@ -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, 178 alert rules
│ │ ├── prometheus/ # config, file_sd targets, 182 alert rules
│ │ ├── alertmanager/ # routing and inhibition
│ │ ├── loki/ # single-binary config + 28 LogQL rules
│ │ ├── alloy/ # the agent config directory, shipped to every host
Expand Down
25 changes: 25 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,31 @@ docstring gives: it is a record, not a claim about now.
registered with github, so no credential on the host reaches the repository;
revoking the old key on github, if it was ever added there as a deploy key, is
off-host and the owner's. The `.claude` removal stands.

- **`mjolnir`'s outlet groups are polled, and the card's last settings are
recorded.**
- **Outlet groups.** The card's outlet-group status and config tables are
now in `generator.yaml`. The control table, which switches the groups,
is left out. Read on 2026-11-24, every group was on, had no load shedding
of any kind, and had a 90-second turn-off delay and a 0-second turn-on
delay. `UpsOutletGroupOff` pages when a group is off for five minutes.
In practice that is only group 2. Turning off group 1 (the firewall and
the core switch) or group 3 (the MokerLink) cuts the monitoring path
first, and the external `Watchdog` heartbeat is what notices.
`UpsOutletGroupLoadShedEnabled` and `UpsOutletGroupDelayChanged` warn
when a setting moves. `UpsOutletGroupsUnread` warns when any group or
column those rules read is missing. `hardware.md` no longer says the
settings are unread.
- **The card's users and SNMPv3 access.** The users are `apc`,
`prometheus`, and the factory `device` and `readonly`. SNMPv3 is allowed
from `prometheus` and `morpheus` only. The owner fixed the card's clock,
and the 2026-11-13 SSH login from `prometheus` was the owner's.
- **`Saruman`'s half of ADR-0107 checked on the box.** All four ordered
guests have `down=90`. Each config file also shows a copy of the setting
without `down=90`, which is a snapshot's saved settings. NUT is 2.8.1,
with `SHUTDOWNEXIT no`, and `nut-monitor` is ordered before
`pve-guests` and active.
- Alert rules: 210 in all, 182 in Prometheus.
- **An audit of `heimdall` found that its browser never updated by itself.
`build-heimdall.md` now trims it to a kiosk.** It was read-only, from the
Mac on Hicks. The same evening every new step was applied to the Pi except
Expand Down
42 changes: 30 additions & 12 deletions docs/hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,29 @@ left, went to the cable modem on 2026-11-22.
**The UPS's outlet groups, read at the rack on 2026-11-07:** the PDU is on
group 1, both laptops' chargers on group 2, and the MokerLink on group 3. The
Smart-UPS X's card can switch and sequence each group separately, so the PDU
— and with it every host but the laptops — is one group. **Group 1's load
shedding was read on 2026-11-24**: shed after 32767 seconds on battery, and
shed below 0 seconds of runtime remaining. Those are the far ends of their
ranges, so neither can cut the PDU before the pack runs out, ticked or not.
**Still not read:** whether group 1 sheds when the UPS is overloaded, and each
group's turn-off and turn-on delays. Check them against the shutdown in
[ADR-0049](adr/0049-shut-down-on-the-ups-from-a-nut-server-on-the-firewall.md)
and the power-up order in the move runbook's §7, and write them here.
[`shut-down-on-the-ups.md`](runbooks/shut-down-on-the-ups.md) reads them
under *Before you start*, because shedding on group 1 would cut the PDU
— and with it every host but the laptops — is one group. **All three groups'
settings were read on 2026-11-24**, at the card and over SNMP:

- **No load shedding on any group.** Shedding on time on battery, on runtime
remaining and on overload is disabled outright. The two thresholds sit at
32767 seconds and 0 seconds, the far ends of their ranges.
- **A 90-second turn-off delay and a 0-second turn-on delay on each group.**
The turn-off delay is how long `morpheus` has to halt after it tells the
UPS to turn off. On 2026-10-29 the groups went off 90 seconds after the
command.

Prometheus reads both tables from the card. `UpsOutletGroupLoadShedEnabled`
and `UpsOutletGroupDelayChanged` warn if a setting moves from the values
above. `UpsOutletGroupsUnread` warns if any of the three groups, or any column
those rules read, stops arriving. `UpsOutletGroupOff` pages if a group goes
off, **but in practice only for group 2.** Group 1 carries the firewall and
the core switch, and group 3 the MokerLink that is `prometheus`'s and
`oracle`'s only network. Either one off cuts the scrape or the way out before
the page can leave. For those two the warning is the external heartbeat going
quiet: `Watchdog`'s pings stop, and the cron-monitor alerts from outside
([`observability.md`](observability.md)).
[`shut-down-on-the-ups.md`](runbooks/shut-down-on-the-ups.md) still reads
them 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.** The UPS's AP9641 card gets an APC
Expand Down Expand Up @@ -370,8 +383,13 @@ warns if a card reset or anyone else moves it. The card's event log gives the
reason. It shows three transfers to battery since 2026-10-29, and the UPS
gave the same cause for all three: distorted input, not a cut. They lasted
279 seconds on 2026-10-29, 1 second on 2026-11-07 and 82 seconds on
2026-11-21. The card's clock keeps UTC−7 all year, so since 2026-11-01 its
log reads an hour ahead of local time.
2026-11-21. Until 2026-11-24 the card's clock kept UTC−7 all year, so from
2026-11-01 its log read an hour ahead of local time. The owner corrected it on
2026-11-24. **Its local users are `apc`, the administrator, `prometheus`, the
SNMPv3 user, and the factory `device` and `readonly` accounts.** Whether those
two are enabled has not been read. The `prometheus` SNMPv3 user is allowed
from two addresses only: `10.0.99.20`, `prometheus`, and `10.0.99.1`, NUT on
`morpheus`.

## WAN

Expand Down
6 changes: 3 additions & 3 deletions docs/observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ separates a quiet stream from a stopped one.

## Alerting

206 rules in total: 178 metric-based in `prometheus/rules/`, and 28 log-based in
210 rules in total: 182 metric-based in `prometheus/rules/`, and 28 log-based in
`loki/rules/`.

### Log-based (Loki ruler)
Expand Down Expand Up @@ -550,7 +550,7 @@ argument and for what to do when it exits 1.

### Metric-based (Prometheus)

178 rules across 13 files in `prometheus/rules/`:
182 rules across 13 files in `prometheus/rules/`:

| File | Covers |
| --- | --- |
Expand Down Expand Up @@ -587,7 +587,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 178 rules of 178 so far ([#843](https://github.com/Gerrrt/HomeLab/issues/843)) — all twelve
against the broken rule too. Coverage is 182 rules of 182 so far ([#843](https://github.com/Gerrrt/HomeLab/issues/843)) — all twelve
in `blackbox.rules.yaml`, all three in `dns.rules.yaml`, all seven in `range.rules.yaml`, `GatewayFilesystemCritical`, `ContainerHighMemory`,
`ContainerNearMemoryLimit`, `ContainerRestartLoop`, `ContainerCpuThrottled`,
the three container-state rules from
Expand Down
2 changes: 1 addition & 1 deletion docs/runbooks/deploy-stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 184: the 178 alert rules this repository counts everywhere
page lists 188: the 182 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
Expand Down
2 changes: 1 addition & 1 deletion docs/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ What this network is actually built to survive:
| Someone on Winterfell or Hicks logging in to `prometheus` | **Key-only `sshd` since 2026-11-23; no host firewall by decision.** `prometheus` holds the estate's CA key and the age key that opens every volume backup set, and converge runs as the operator, who is in `sudo` and `docker`. Its `sshd` answers all of Hicks (by `morpheus`'s pass for `22` to the segment) and every host on VLAN 99. The audit's root-only reads on 2026-11-23 found it taking passwords, with X11 forwarding on and `ufw` inactive. [ADR-0128](adr/0128-give-prometheus-a-key-only-sshd-and-no-host-firewall.md) makes `sshd` key-only through a drop-in that outranks cloud-init's, refusing root and X11 forwarding ([`restore-the-stack.md`](runbooks/restore-the-stack.md#make-sshd-key-only)). It adds no host firewall, because Docker's rules run ahead of `ufw`'s for the published ports, so a policy would cover `22` alone. Those ports stay fenced as before: by `morpheus` by destination, by the ingest proxy's tokens on `9090` and `3100`, and on `6514` by the syslog listener's pinned client certificate and its sender list. The step was applied the same day. `sshd -T` read `no` for all four settings, a password login and a keyboard-interactive login were each refused with `Permission denied (publickey)`, and a key login from Hicks succeeded after the reload. |
| Someone on Hicks or Winterfell logging in to `smaug` | **Key-only `sshd` since 2026-11-24.** `smaug` holds the household's media and the `erebor` pool. Two hosts reach its `22`, each by a host-scoped pass on `morpheus` ([`network.md`](network.md)): `prometheus`, as the read-only backup user `frodo`, and `desktop-02` on Hicks, as the administrator `gerrrt`. From 2026-11-13 `gerrrt` logged in by password, allowed both on the user and in the SSH service's *Password Login Groups*, while the documents said `frodo` was the only user. Both settings were cleared in the TrueNAS UI on 2026-11-24. `sshd_config` then had no `Match` block left, and a connection as `gerrrt` or `root` was offered `publickey` alone. |
| 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 | 206 alert rules, 30 days of metrics and logs |
| Losing visibility of a failure | 210 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 |
Expand Down
2 changes: 1 addition & 1 deletion stacks/observability/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 178 alert rules: host, network, ups, containers, blackbox,
rules/*.rules.yaml 182 alert rules: host, network, ups, containers, blackbox,
dns, backup, ids, deploy, stack, internet, watchdog and range
tests/*.test.yaml promtool unit tests — assert the rules can fire
blackbox/blackbox.yaml probe modules — reachability, and what a resolver said
Expand Down
Loading