From bfe6987867b0799c1cf852e593ee66a596be28aa Mon Sep 17 00:00:00 2001 From: "Jokob @NetAlertX" <96159884+jokob-sk@users.noreply.github.com> Date: Fri, 14 Nov 2025 10:07:47 +0000 Subject: [PATCH] BE: before_name_updates change #1251 --- server/__main__.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/server/__main__.py b/server/__main__.py index 504f800f..bb149e32 100755 --- a/server/__main__.py +++ b/server/__main__.py @@ -154,26 +154,24 @@ def main(): # Name resolution # -------------------------------------------- - # run plugins before notification processing (e.g. Plugins to discover device names) - pm.run_plugin_scripts("before_name_updates") - - # Resolve devices names - mylog("debug", "[Main] Resolve devices names") - update_devices_names(pm) - - # -------- - # Reporting - - # Check if new devices found + # Check if new devices found (created by process_scan) sql.execute(sql_new_devices) newDevices = sql.fetchall() db.commitDB() - # new devices were found + # If new devices were found, run all plugins registered to be run when new devices are found + # Run these before name resolution so plugins like NSLOOKUP that are configured + # for `on_new_device` can populate names used in the notifications below. if len(newDevices) > 0: - # run all plugins registered to be run when new devices are found pm.run_plugin_scripts("on_new_device") + # run plugins before notification processing (e.g. Plugins to discover device names) + pm.run_plugin_scripts("before_name_updates") + + # Resolve devices names (will pick up results from on_new_device plugins above) + mylog("debug", "[Main] Resolve devices names") + update_devices_names(pm) + # Notification handling # ----------------------------------------