Repository navigation
feat(trinity): collect SMART from trinity's own disks - #1597
Merged
Merged
Conversation
trinity was the one Alloy host with a checkout that read no SMART. A new sensitive-profile timer runs collect-smart-state.sh as root daily at 08:30, through a new make target that skips the baseline table so the SmartDriveBadSectors join keeps one copy. The build runbook installs smartmontools. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The service cannot collect SMART data because ProtectSystem=strict makes its default lock directory read-only, causing both priming and timer runs to fail unless a writable lock directory is configured.
1 open issue
What changed in this PR
Adds daily SMART collection for trinity’s local disks using the existing collector and alert rules, without duplicating the monitoring host’s SMART baselines.
Changes:
- Adds a root-run sensitive-profile service and persistent daily 08:30 timer.
- Registers a collector-only Make target and scheduled job with a two-day freshness threshold.
- Updates installation prerequisites, first-run checks, scheduling documentation, and the changelog.
| File | Description |
|---|---|
systemd/sensitive/homelab-smart-state-sensitive.timer |
Schedules daily collection with missed-run recovery. |
systemd/sensitive/homelab-smart-state-sensitive.service |
Runs the collector through the scheduled-job wrapper with sandboxing. |
systemd/README.md |
Lists the new sensitive-profile timer. |
scripts/install-timers.sh |
Registers and primes the SMART job. |
Makefile |
Adds collection without rendering shared baselines. |
docs/runbooks/schedule-maintenance.md |
Documents scheduling, freshness, and baseline isolation. |
docs/runbooks/build-the-sensitive-tier-host.md |
Adds smartmontools and first-run verification steps. |
docs/changelog.md |
Records the new SMART collection setup. |
Review effort: Balanced
ProtectSystem=strict leaves /run/lock read-only, and run-scheduled.sh opens its lock there before running anything, so every run would have failed. HOMELAB_LOCK_DIR points it at the textfile directory, the one writable path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 of 6 tasks
Gerrrt
added a commit
that referenced
this pull request
Nov 21, 2026
… lock dir (#1598) The photo disk's Seagate enclosure (0bc2:ab18, uas) answers no ATA pass-through, so the docs that promised a health row for it now say it has none. The lock-directory commit merged with #1597 rested on a false claim that /run/lock is read-only under ProtectSystem=strict; the monitoring host's identically sandboxed unit locks there daily, so this unit goes back to it. 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
trinitygets a daily SMART read of its own disks: the boot NVMe that holds the sensitive tier, and the USB photo disk at/srv/immich. A new sensitive-profile timer,homelab-smart-state-sensitive(08:30, root), runs the existingcollect-smart-state.shthrough a new make target,smart-state-sensitive. It writessmart-state-trinity.prom, which the existingSmartDrive*rules andSmartStateStalealready read for any host. The build runbook's step 4 now installssmartmontools, and step 12 says how to read the first run.Why
The trinity audit of 2026-11-13 found that
trinitywas the one host with a checkout and Alloy that collected no SMART. A failing NVMe under the password vault, or a failing photo disk, would have shown first as I/O errors. The repo neither recorded nor decided this gap.It is a new target, not
make smart-state, because that target also renderssmart-baselines.prom.SmartDriveBadSectorsjoins that fileon(host, slot)from the single copy on the monitoring host, so a second copy fromtrinitywould put two series on every key and break the join for every drive.Blast radius
trinityonly: one new root oneshot unit, no network (PrivateNetwork=true), with one writable path, the textfile directory. Ifsmartmontoolsis missing, the job fails andScheduledJobFailedpages. It does not report a clean run.secrets/*.sops.yamlVerification
python3 scripts/check_docs.py:docs OK../scripts/install-timers.sh --check --profile sensitive: 0 FAIL.smart-state-sensitive: *-*-* 08:30:00 every 86400s, alerts at 172800s, the rendered units passsystemd-analyze verify, and no job name is declared by both profiles. Three off-host checks skip, as they do outside the deployment checkout../scripts/lint.sh: passed. 4 tools were unavailable and skipped (yamllint, ruff ×2, ansible-lint), so CI is the run that covers them.shellcheck on
install-timers.sh: clean.I did not run full
make validate; CI does.Not deployed yet. After merge, on
trinity, runsudo apt-get install -y smartmontools, thenmake install-timers PROFILE=sensitivefrom the deployment checkout, then read the two files that step 12 names. Whether the USB bridges pass SMART through can only be seen on that first run.make validatepassesDeployed to the lab and confirmed working
Docs updated (
docs/, service README, ordocs/roadmap.md)🤖 Generated with Claude Code