Fix down alerts and improve txt template

This commit is contained in:
Joshua
2022-07-29 21:03:01 +10:00
parent 5b783ebff9
commit 5e98961faa
2 changed files with 11 additions and 8 deletions

View File

@@ -1184,6 +1184,11 @@ def email_reporting ():
(
SELECT dev_MAC FROM Devices WHERE dev_AlertEvents = 0
)""")
sql.execute ("""UPDATE Events SET eve_PendingAlertEmail = 0
WHERE eve_PendingAlertEmail = 1 AND eve_EventType = 'Device Down' AND eve_MAC IN
(
SELECT dev_MAC FROM Devices WHERE dev_AlertDeviceDown = 0
)""")
# Open text Template
template_file = open(PIALERT_BACK_PATH + '/report_template.txt', 'r')