mirror of
https://github.com/zvx-echo6/meshai.git
synced 2026-06-11 09:24:44 +02:00
feat: Full alert engine — 17 conditions, scaling cooldown, per-condition TUI toggles
Alert conditions across all 5 pillars: Infrastructure: offline, recovery, new router Power: battery 50/25/10%, 7-day trend, USB→battery, solar not charging Utilization: sustained >20% for 6h, packet flood >500/24h Coverage: infra single gateway, feeder offline, region blackout Scores: mesh <70, region <60 Scaling cooldown: immediate → 12h → 24h → 48h → stop Recovery notifications when conditions resolve Per-condition on/off toggles in TUI Battery trend queries SQLite node_snapshots for 7-day history Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
c8400233bd
commit
736d6a313a
4 changed files with 712 additions and 194 deletions
|
|
@ -279,10 +279,10 @@ class MeshAI:
|
|||
health_engine=self.health_engine,
|
||||
reporter=self.mesh_reporter,
|
||||
subscription_manager=self.subscription_manager,
|
||||
critical_nodes=getattr(mi, 'critical_nodes', []),
|
||||
alert_cooldown_minutes=getattr(mi, 'alert_cooldown_minutes', 30),
|
||||
config=mi,
|
||||
db_path="/data/mesh_history.db",
|
||||
)
|
||||
logger.info(f"Alert engine initialized (critical nodes: {getattr(mi, 'critical_nodes', [])})")
|
||||
logger.info(f"Alert engine initialized (critical: {mi.critical_nodes}, channel: {mi.alert_channel})")
|
||||
|
||||
# Knowledge base (optional - gracefully degrade if deps missing)
|
||||
kb_cfg = self.config.knowledge
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue