- include SMB drop-ins from /etc/samba/smb.conf.d into the generated smb.conf - keep smbd/nfs-server running while other services (/etc/exports.d, drop-ins) share, instead of disabling them when nasmon has no shares of its own - list those shares read-only on /shares - settings: RepoISO URL; poll its /api/integration/status, dashboard card, menu link, alerts for portal down, stale worker, failed jobs, unmounted publications Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package alert
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"nasmon/internal/collect"
|
||||
)
|
||||
|
||||
func TestRepoISORules(t *testing.T) {
|
||||
base := Input{Now: time.Now()}
|
||||
if ev := Evaluate(base); len(ev) != 0 {
|
||||
t.Fatalf("integration off must not alert: %v", keys(ev))
|
||||
}
|
||||
|
||||
in := base
|
||||
in.RepoISO = &collect.RepoISO{URL: "http://127.0.0.1", Error: "connection refused"}
|
||||
ev := Evaluate(in)
|
||||
if !has(ev, "repoiso:api:down") || len(ev) != 1 || ev[0].Level != LevelCrit {
|
||||
t.Fatalf("down: %v", keys(ev))
|
||||
}
|
||||
|
||||
in.RepoISO = &collect.RepoISO{Reachable: true, WorkerAlive: false, JobsFailed24h: 2, PublicationsError: 1}
|
||||
ev = Evaluate(in)
|
||||
for _, k := range []string{"repoiso:worker:stale", "repoiso:jobs:failed", "repoiso:publications:error"} {
|
||||
if !has(ev, k) {
|
||||
t.Errorf("missing %s in %v", k, keys(ev))
|
||||
}
|
||||
}
|
||||
|
||||
in.RepoISO = &collect.RepoISO{Reachable: true, WorkerAlive: true}
|
||||
if ev = Evaluate(in); len(ev) != 0 {
|
||||
t.Fatalf("healthy RepoISO alerted: %v", keys(ev))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user