refactor: split host alert checker

Move host-agent identity, metric projection, disk/SMART/RAID/Unraid health handling, cleanup, and offline lifecycle into internal/alerts/host.go.

Keep shared health-assessment evaluation package-level for now because storage ZFS and host SMART/RAID still share that bridge, while recording host.go as the host checker owner in the alerts subsystem contract.

Proof: go test ./internal/alerts/...
This commit is contained in:
rcourtman
2026-05-06 13:50:13 +01:00
parent 3d8cb6c8a5
commit 8a21162f35
4 changed files with 1049 additions and 1017 deletions
File diff suppressed because it is too large Load Diff
+9
View File
@@ -316,6 +316,15 @@ func TestNodeDisplayNameCacheKeyTrimsParts(t *testing.T) {
}
}
func TestHostResourceIDTrimsID(t *testing.T) {
if got := hostResourceID(" host-1 "); got != "agent:host-1" {
t.Fatalf("hostResourceID() = %q, want %q", got, "agent:host-1")
}
if got := hostResourceID(" \t "); got != "agent:unknown" {
t.Fatalf("blank hostResourceID() = %q, want %q", got, "agent:unknown")
}
}
func TestQuietHoursCategoryForResourceIncidentUsesIncidentCategoryMetadata(t *testing.T) {
availability := &Alert{
Type: "resource-incident",
File diff suppressed because it is too large Load Diff