Tune load thresholds for status and alerts
This commit is contained in:
@@ -21,10 +21,13 @@ async def cmd_status(msg: Message):
|
||||
minutes, _ = divmod(rem, 60)
|
||||
|
||||
load1 = psutil.getloadavg()[0]
|
||||
load_warn = float(cfg.get("thresholds", {}).get("load_warn", 2.0))
|
||||
high_warn = float(cfg.get("thresholds", {}).get("high_load_warn", load_warn * 1.5))
|
||||
|
||||
cpu_icon = "🟢"
|
||||
if load1 > 2.0:
|
||||
if load1 > high_warn:
|
||||
cpu_icon = "🔴"
|
||||
elif load1 > 1.0:
|
||||
elif load1 > load_warn:
|
||||
cpu_icon = "🟡"
|
||||
|
||||
mem = psutil.virtual_memory()
|
||||
|
||||
Reference in New Issue
Block a user