Add periodic resource alerts
This commit is contained in:
3
main.py
3
main.py
@@ -4,6 +4,7 @@ from datetime import datetime
|
||||
from app import bot, dp, cfg, ADMIN_ID
|
||||
from keyboards import menu_kb
|
||||
from services.docker import discover_containers, docker_watchdog
|
||||
from services.alerts import monitor_resources
|
||||
from services.notify import notify
|
||||
import state
|
||||
import handlers.menu
|
||||
@@ -29,6 +30,8 @@ async def main():
|
||||
state.DOCKER_MAP.update(await discover_containers(cfg))
|
||||
if cfg.get("docker", {}).get("watchdog", True):
|
||||
asyncio.create_task(docker_watchdog(state.DOCKER_MAP, notify, bot, ADMIN_ID))
|
||||
if cfg.get("alerts", {}).get("enabled", True):
|
||||
asyncio.create_task(monitor_resources(cfg, notify, bot, ADMIN_ID))
|
||||
await notify_start()
|
||||
await dp.start_polling(bot)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user