From 5e98961faafc17df2b43014776c1277db64bd99a Mon Sep 17 00:00:00 2001 From: Joshua Date: Fri, 29 Jul 2022 21:03:01 +1000 Subject: [PATCH] Fix down alerts and improve txt template --- back/pialert.py | 5 +++++ back/report_template.txt | 14 ++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/back/pialert.py b/back/pialert.py index fcbe2933..d2376399 100644 --- a/back/pialert.py +++ b/back/pialert.py @@ -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') diff --git a/back/report_template.txt b/back/report_template.txt index 9a2d72e3..9f5ebdad 100644 --- a/back/report_template.txt +++ b/back/report_template.txt @@ -1,12 +1,6 @@ Report Date: -Scan Cycle: Server: - - -Internet ----------------------- - - + New Devices ---------------------- @@ -18,4 +12,8 @@ Devices Down Events ---------------------- - + +Internet +---------------------- + + \ No newline at end of file