Add selftest scheduler, queue history, and OpenWrt signal stats
This commit is contained in:
@@ -12,6 +12,7 @@ async def monitor_resources(cfg, notify, bot, chat_id):
|
||||
cooldown = int(alerts_cfg.get("cooldown_sec", 900))
|
||||
notify_recovery = bool(alerts_cfg.get("notify_recovery", True))
|
||||
load_only_critical = bool(alerts_cfg.get("load_only_critical", False))
|
||||
auto_mute_high_load_sec = int(alerts_cfg.get("auto_mute_on_high_load_sec", 0))
|
||||
|
||||
disk_warn = int(cfg.get("thresholds", {}).get("disk_warn", 80))
|
||||
snapshot_warn = int(cfg.get("disk_report", {}).get("threshold", disk_warn))
|
||||
@@ -72,6 +73,10 @@ async def monitor_resources(cfg, notify, bot, chat_id):
|
||||
key = "load_high_crit" if level == 2 else "load_high_warn"
|
||||
await notify(bot, chat_id, f"{icon} Load high: {load:.2f}", level=level_name, key=key, category="load")
|
||||
last_sent["load"] = now
|
||||
if level == 2 and auto_mute_high_load_sec > 0:
|
||||
from services.alert_mute import set_mute
|
||||
|
||||
set_mute("load", auto_mute_high_load_sec)
|
||||
state["load_level"] = level
|
||||
|
||||
await asyncio.sleep(interval)
|
||||
|
||||
Reference in New Issue
Block a user