Implement comprehensive status calculation and notification system
Agent Changes: • Add CPU status thresholds (warning: ≥5.0, critical: ≥8.0) • Add memory status thresholds (warning: ≥80%, critical: ≥95%) • Add service status calculation (critical if failed>0, warning if degraded>0) • All collectors now calculate and include status in output Dashboard Changes: • Update system widget to use agent-calculated cpu_status and memory_status • Update services widget to use agent-calculated services_status • Remove client-side status calculations in favor of agent status • Add status_level_from_agent_status helper function Notification System: • Add SMTP email notification system using lettre crate • Auto-configure notifications: hostname@cmtec.se → cm@cmtec.se • Smart change detection with rate limiting (30min cooldown) • Only notify on transitions to/from warning/critical states • Rich email formatting with host, component, metric details
This commit is contained in:
@@ -9,6 +9,7 @@ mod agent;
|
||||
mod collectors;
|
||||
mod config;
|
||||
mod discovery;
|
||||
mod notifications;
|
||||
mod scheduler;
|
||||
|
||||
use agent::MetricsAgent;
|
||||
|
||||
Reference in New Issue
Block a user