From 17f2421836e8a5ba68b11e78b199d6ae987773a7 Mon Sep 17 00:00:00 2001 From: Jokob-sk Date: Sat, 24 Jun 2023 07:55:03 +1000 Subject: [PATCH] Debug and attempt for #261 --- pialert/device.py | 6 ++++++ pialert/networkscan.py | 2 ++ 2 files changed, 8 insertions(+) diff --git a/pialert/device.py b/pialert/device.py index a29d9ffc..38308d48 100755 --- a/pialert/device.py +++ b/pialert/device.py @@ -17,6 +17,12 @@ def save_scanned_devices (db, p_arpscan_devices, p_cycle_interval): sql = db.sql #TO-DO cycle = 1 # always 1, only one cycle supported + mylog('debug', ['[ARP Scan] Detected devices:', len(p_arpscan_devices)]) + + p_arpscan_devices = conf.arpscan_devices + + mylog('debug', ['[ARP Scan] Detected devices in conf:', len(p_arpscan_devices)]) + # Delete previous scan data sql.execute ("DELETE FROM CurrentScan WHERE cur_ScanCycle = ?", (cycle,)) diff --git a/pialert/networkscan.py b/pialert/networkscan.py index bf3fa658..1f07b692 100755 --- a/pialert/networkscan.py +++ b/pialert/networkscan.py @@ -77,6 +77,8 @@ def process_scan (db, arpscan_devices): # Load current scan data mylog('verbose','[Process Scan] Processing scan results') save_scanned_devices (db, arpscan_devices, cycle_interval) + + db.commitDB() # Print stats mylog('none','[Process Scan] Print Stats')