Expand guest agent system monitoring
This commit is contained in:
@@ -55,3 +55,16 @@ func TestAgentReportAuthenticationAndOfflineState(t *testing.T) {
|
||||
t.Fatal("stale agent is online")
|
||||
}
|
||||
}
|
||||
|
||||
func TestAgentProblemsBecomeMaintenanceAwareAlerts(t *testing.T) {
|
||||
metrics := dashboardMetrics{Agents: []ManagedAgent{{ID: "node", Name: "app", VMID: 105, Online: true, Report: AgentReport{
|
||||
Services: []AgentService{{Name: "postgres.service", State: "failed", SubState: "failed"}},
|
||||
Containers: []AgentContainer{{ID: "dead", Name: "web", State: "exited", Status: "Exited (1)"}}, DockerAvailable: true,
|
||||
}}}}
|
||||
alerts := evaluateAlerts(metrics, defaultThresholds())
|
||||
window := MaintenanceWindow{Active: true, VMIDs: []int{105}}
|
||||
active, planned := splitMaintenanceAlerts(alerts, window)
|
||||
if len(planned) != 2 || len(active) != 0 {
|
||||
t.Fatalf("active=%d planned=%d alerts=%#v", len(active), len(planned), alerts)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user