mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Report fix + missing-in-last-scan functionality
This commit is contained in:
@@ -563,17 +563,18 @@ def process_plugin_events(db, plugin, pluginsState, plugEventsArr):
|
|||||||
index += 1
|
index += 1
|
||||||
|
|
||||||
# Loop thru events and check if previously available objects are missing
|
# Loop thru events and check if previously available objects are missing
|
||||||
# Create a set of hashes of IDs in pluginObjects
|
for tmpObj in pluginObjects:
|
||||||
plugin_objects_ids_hash = set(x.idsHash for x in pluginObjects)
|
|
||||||
|
isMissing = True
|
||||||
|
|
||||||
for tmpObjFromEvent in pluginEvents:
|
for tmpObjFromEvent in pluginEvents:
|
||||||
if tmpObjFromEvent.idsHash not in plugin_objects_ids_hash:
|
if tmpObj.idsHash == tmpObjFromEvent.idsHash:
|
||||||
for x in pluginObjects:
|
isMissing = False
|
||||||
if x.primaryId == tmpObjFromEvent.primaryId and x.secondaryId == tmpObjFromEvent.secondaryId:
|
|
||||||
mylog('debug', ['[Plugins] Missing from last scan: ', x.primaryId , x.secondaryId])
|
if isMissing:
|
||||||
x.status = "missing-in-last-scan"
|
tmpObj.status = "missing-in-last-scan"
|
||||||
x.changed = datetime.now(timeZone).strftime("%Y-%m-%d %H:%M:%S")
|
tmpObj.changed = timeNowTZ()
|
||||||
break
|
mylog('debug', ['[Plugins] Missing from last scan: ', x.primaryId , x.secondaryId])
|
||||||
|
|
||||||
|
|
||||||
# Merge existing plugin objects with newly discovered ones and update existing ones with new values
|
# Merge existing plugin objects with newly discovered ones and update existing ones with new values
|
||||||
|
|||||||
Reference in New Issue
Block a user