Debug output for #474

This commit is contained in:
Jokob-sk
2023-10-14 11:38:44 +11:00
parent 3e3e8fa797
commit a3702fed94
4 changed files with 37 additions and 4 deletions

View File

@@ -63,6 +63,36 @@ def print_scan_stats(db):
mylog('verbose', f'[Scan Stats] Disconnections.........: {stats[0]["disconnections"]}')
mylog('verbose', f'[Scan Stats] IP Changes.............: {stats[0]["ip_changes"]}')
if str(stats[0]["new_devices"]) != '0':
mylog('debug', f' ================ DEVICES table content ================')
sql.execute('select * from Devices')
rows = sql.fetchall()
for row in rows:
row_dict = dict(row)
mylog('debug', f' {row_dict}')
mylog('debug', f' ================ CurrentScan table content ================')
sql.execute('select * from CurrentScan')
rows = sql.fetchall()
for row in rows:
row_dict = dict(row)
mylog('debug', f' {row_dict}')
mylog('debug', f' ================ Events table content where eve_PendingAlertEmail = 1 ================')
sql.execute('select * from Events where eve_PendingAlertEmail = 1')
rows = sql.fetchall()
for row in rows:
row_dict = dict(row)
mylog('debug', f' {row_dict}')
mylog('debug', f' ================ Events table COUNT ================')
sql.execute('select count(*) from Events')
rows = sql.fetchall()
for row in rows:
row_dict = dict(row)
mylog('debug', f' {row_dict}')
mylog('verbose', '[Scan Stats] Scan Method Statistics:')
for row in stats:
if row["cur_ScanMethod"] is not None:

View File

@@ -455,7 +455,7 @@ def process_plugin_events(db, plugin, pluginsState, plugEventsArr):
if tmpObj.status != "missing-in-last-scan":
tmpObj.changed = timeNowTZ().strftime('%Y-%m-%d %H:%M:%S')
tmpObj.status = "missing-in-last-scan"
mylog('debug', [f'[Plugins] Missing from last scan (PrimaryID | SecondaryID): {tmpObj.primaryId} | {tmpObj.secondaryId}'])
# mylog('debug', [f'[Plugins] Missing from last scan (PrimaryID | SecondaryID): {tmpObj.primaryId} | {tmpObj.secondaryId}'])
# Merge existing plugin objects with newly discovered ones and update existing ones with new values

View File

@@ -143,13 +143,13 @@ def get_notifications (db):
mylog('verbose', ['[Notification] Open html Template'])
# select template type depoending if running latest version or an older one
if conf.newVersionAvailable :
template_file_path = '/back/report_template_new_version.html'
else:
template_file_path = '/back/report_template.html'
mylog('verbose', ['[Notification] Using template', template_file_path])
mylog('verbose', ['[Notification] Using template', template_file_path])
template_file = open(pialertPath + template_file_path, 'r')
mail_html = template_file.read()