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')

View File

@@ -1,12 +1,6 @@
Report Date: <REPORT_DATE>
Scan Cycle: <SCAN_CYCLE>
Server: <SERVER_NAME>
<SECTION_INTERNET>
Internet
----------------------
<TABLE_INTERNET>
</SECTION_INTERNET><SECTION_NEW_DEVICES>
<SECTION_NEW_DEVICES>
New Devices
----------------------
<TABLE_NEW_DEVICES>
@@ -18,4 +12,8 @@ Devices Down
Events
----------------------
<TABLE_EVENTS>
</SECTION_EVENTS>
</SECTION_EVENTS><SECTION_INTERNET>
Internet
----------------------
<TABLE_INTERNET>
</SECTION_INTERNET>