From d2d904cf06b7a7c149b2f17574d5b3d7b7da9faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20M=C3=BCller?= Date: Fri, 26 Mar 2021 23:35:55 +0100 Subject: [PATCH] #8 Sending Telegram message to Paddy in case the SQL server is down --- main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.py b/main.py index 53a981e..fbcfbca 100644 --- a/main.py +++ b/main.py @@ -9,6 +9,9 @@ def runPings(): telegram = TelegramHandler.TelegramHandler() conn = SQLConnectionHandler.getConnection() + if not conn: + telegram.sendMessage('230970888', 'Your SQL Server seems to be offline. Maybe give it a check as soon as possible.') + # Get data from SQL users = getUsers(conn) servers = getServersToPing(conn)