From bcd9804636fa8b9c7933c09479508af82d8d52dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20M=C3=BCller?= Date: Sun, 29 Aug 2021 20:02:08 +0200 Subject: [PATCH] Pinging only active servers / websites --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 52ac91a..c77aeb1 100644 --- a/main.py +++ b/main.py @@ -101,7 +101,7 @@ def getUsers(conn: pymysql.Connection) -> {}: def getServersToPing(conn: pymysql.Connection) -> [{}]: cur = conn.cursor() - cur.execute("SELECT server_id, admin_id, name, hostname FROM servers") + cur.execute("SELECT server_id, admin_id, name, hostname FROM servers WHERE monitoring_active = 1") results = cur.fetchall() servers = [] cur.close() @@ -119,7 +119,7 @@ def getServersToPing(conn: pymysql.Connection) -> [{}]: def getWebsitesToPing(conn: pymysql.Connection) -> [{}]: cur = conn.cursor() - cur.execute("SELECT website_id, admin_id, name, url FROM websites") + cur.execute("SELECT website_id, admin_id, name, url FROM websites WHERE monitoring_active = 1") results = cur.fetchall() websites = [] cur.close()