Pinging only active servers / websites
This commit is contained in:
parent
fd89bf42c4
commit
bcd9804636
4
main.py
4
main.py
|
@ -101,7 +101,7 @@ def getUsers(conn: pymysql.Connection) -> {}:
|
||||||
|
|
||||||
def getServersToPing(conn: pymysql.Connection) -> [{}]:
|
def getServersToPing(conn: pymysql.Connection) -> [{}]:
|
||||||
cur = conn.cursor()
|
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()
|
results = cur.fetchall()
|
||||||
servers = []
|
servers = []
|
||||||
cur.close()
|
cur.close()
|
||||||
|
@ -119,7 +119,7 @@ def getServersToPing(conn: pymysql.Connection) -> [{}]:
|
||||||
|
|
||||||
def getWebsitesToPing(conn: pymysql.Connection) -> [{}]:
|
def getWebsitesToPing(conn: pymysql.Connection) -> [{}]:
|
||||||
cur = conn.cursor()
|
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()
|
results = cur.fetchall()
|
||||||
websites = []
|
websites = []
|
||||||
cur.close()
|
cur.close()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user