Pinging only active servers / websites

This commit is contained in:
Patrick Müller 2021-08-29 20:02:08 +02:00
parent fd89bf42c4
commit bcd9804636

View File

@ -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()