v0.169.0: disk-health card + degradation notification (Lemezek állapota)

Consumes the agent v0.94.0 smart payload (MinAgent floor unchanged; feature-detect
by presence). One pure verdict fn agentapi.DiskVerdictFor shared by the dashboard
card and the 6h check. Card via a 60s /disks TTL cache (anti-smartctl-storm);
unreachable agent -> Nincs adat, page never blocks. disk-health-check (6h) emits
disk_health_degraded on a degradation only vs an in-memory baseline (first run
silent, recovery/UNKNOWN never notify, multi-attr -> one event). No global banner
(deliberate). Pairs with the hub allowlist bump.

Tests: verdict table (>=90 red-proof), notifier emit, check first-run-silent
(red-proof), degradation-once, recovery-silent, UNKNOWN-excluded, FAILING-critical,
nil-smart card, TTL cache.
This commit is contained in:
2026-07-24 21:27:16 +02:00
parent e164fef70c
commit c97975c1df
16 changed files with 741 additions and 5 deletions
+7
View File
@@ -959,6 +959,13 @@ func main() {
stackMgr.RecoverMigration(ctx)
webServer.SetEncryptionKey(encKey)
webServer.SetAppExporter(appExporter)
// Disk-health degradation check (v0.169.0): every 6h, compare each physical disk's SMART verdict
// against the in-memory baseline and emit disk_health_degraded on a degradation only (first run
// baselines silently; recovery/UNKNOWN never notify). Only on a provisioned guest (an agent to
// read /disks from); the check no-ops gracefully if the agent is unreachable.
if cfg.LocalAPI.Endpoint != "" {
sched.Every("disk-health-check", 6*time.Hour, webServer.RunDiskHealthCheck)
}
// Browser .fab upload (v0.128.0): upload state is in-memory, so a restart strands the .part —
// GC stray part files in every registered drive's exports dir at startup.
webServer.CleanupStaleUploadParts()