mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-11 04:31:25 -07:00
(Unknown) vendor not updated #889
This commit is contained in:
0
front/php/templates/language/fr_fr.json
Normal file → Executable file
0
front/php/templates/language/fr_fr.json
Normal file → Executable file
@@ -60,7 +60,7 @@ def cleanup_database (dbPath, DAYS_TO_KEEP_EVENTS, PHOLUS_DAYS_DATA, HRS_TO_KEEP
|
|||||||
mylog('verbose', [f'[{pluginName}] Upkeep Database:' ])
|
mylog('verbose', [f'[{pluginName}] Upkeep Database:' ])
|
||||||
|
|
||||||
# Connect to the App database
|
# Connect to the App database
|
||||||
conn = sqlite3.connect(dbPath)
|
conn = sqlite3.connect(dbPath, timeout=30)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
@@ -149,7 +149,7 @@ def cleanup_database (dbPath, DAYS_TO_KEEP_EVENTS, PHOLUS_DAYS_DATA, HRS_TO_KEEP
|
|||||||
# Cleanup Offline Devices
|
# Cleanup Offline Devices
|
||||||
if HRS_TO_KEEP_OFFDEV != 0:
|
if HRS_TO_KEEP_OFFDEV != 0:
|
||||||
mylog('verbose', [f'[{pluginName}] Devices: Delete all New Devices older than {str(HRS_TO_KEEP_OFFDEV)} hours (HRS_TO_KEEP_OFFDEV setting)'])
|
mylog('verbose', [f'[{pluginName}] Devices: Delete all New Devices older than {str(HRS_TO_KEEP_OFFDEV)} hours (HRS_TO_KEEP_OFFDEV setting)'])
|
||||||
query = f"""DELETE FROM Devices WHERE devPresentLastScan = 0 AND devLastConnection < date('now', '-{str(HRS_TO_KEEP_OFFDEV)} hour'))"""
|
query = f"""DELETE FROM Devices WHERE devPresentLastScan = 0 AND devLastConnection < date('now', '-{str(HRS_TO_KEEP_OFFDEV)} hour')"""
|
||||||
mylog('verbose', [f'[{pluginName}] Query: {query} '])
|
mylog('verbose', [f'[{pluginName}] Query: {query} '])
|
||||||
cursor.execute (query)
|
cursor.execute (query)
|
||||||
|
|
||||||
|
|||||||
@@ -439,8 +439,8 @@ def update_devices_data_from_scan (db):
|
|||||||
# Update VENDORS
|
# Update VENDORS
|
||||||
recordsToUpdate = []
|
recordsToUpdate = []
|
||||||
query = """SELECT * FROM Devices
|
query = """SELECT * FROM Devices
|
||||||
WHERE devVendor = '(unknown)' OR devVendor =''
|
WHERE devVendor IS NULL OR devVendor IN ("", "null", "(unknown)", "(Unknown)")
|
||||||
OR devVendor IS NULL"""
|
"""
|
||||||
|
|
||||||
for device in sql.execute (query) :
|
for device in sql.execute (query) :
|
||||||
vendor = query_MAC_vendor (device['devMac'])
|
vendor = query_MAC_vendor (device['devMac'])
|
||||||
@@ -469,8 +469,8 @@ def update_devices_data_from_scan (db):
|
|||||||
# Guess Type
|
# Guess Type
|
||||||
recordsToUpdate = []
|
recordsToUpdate = []
|
||||||
query = """SELECT * FROM Devices
|
query = """SELECT * FROM Devices
|
||||||
WHERE devType in ('', 'null')
|
WHERE devType in ('', 'null')
|
||||||
OR devType IS NULL"""
|
OR devType IS NULL"""
|
||||||
default_type = get_setting_value('NEWDEV_devType')
|
default_type = get_setting_value('NEWDEV_devType')
|
||||||
|
|
||||||
for device in sql.execute (query) :
|
for device in sql.execute (query) :
|
||||||
|
|||||||
Reference in New Issue
Block a user