Add quiet hours, health checks, and logging
This commit is contained in:
@@ -46,10 +46,13 @@ async def monitor_ssl(cfg: dict[str, Any], notify, bot, chat_id: int):
|
||||
key = f"{name}:{threshold}"
|
||||
last_time = last_sent.get(key, 0)
|
||||
if time.time() - last_time >= cooldown:
|
||||
level = "critical" if days_left <= 1 else "warn"
|
||||
await notify(
|
||||
bot,
|
||||
chat_id,
|
||||
f"⚠️ SSL `{name}` expires in {days_left}d (threshold {threshold}d)",
|
||||
level=level,
|
||||
key=f"ssl:{name}:{threshold}",
|
||||
)
|
||||
last_sent[key] = time.time()
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user