mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 00:40:10 +00:00
Network discovery script is now enabled only is preferences are set to on
This commit is contained in:
parent
e57f35e4c7
commit
f144d97b75
1 changed files with 23 additions and 21 deletions
|
|
@ -1,29 +1,31 @@
|
|||
--
|
||||
-- (C) 2013-24 - ntop.org
|
||||
--
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
|
||||
local discover_utils = require "discover_utils"
|
||||
local callback_utils = require "callback_utils"
|
||||
|
||||
-- ########################################################
|
||||
|
||||
if(ntop.limitResourcesUsage()) then return end
|
||||
|
||||
-- ########################################################
|
||||
local prefs = ntop.getPrefs()
|
||||
|
||||
local ifnames = interface.getIfNames()
|
||||
|
||||
-- ########################################################
|
||||
|
||||
local oneshot_discovery_condition = function(ifId)
|
||||
local check_requested = discover_utils.networkDiscoveryRequested(ifId)
|
||||
return check_requested
|
||||
if(prefs.active_monitoring == true) then
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
|
||||
local discover_utils = require "discover_utils"
|
||||
local callback_utils = require "callback_utils"
|
||||
|
||||
-- ########################################################
|
||||
|
||||
local ifnames = interface.getIfNames()
|
||||
|
||||
-- ########################################################
|
||||
|
||||
local oneshot_discovery_condition = function(ifId)
|
||||
local check_requested = discover_utils.networkDiscoveryRequested(ifId)
|
||||
return check_requested
|
||||
end
|
||||
|
||||
-- ########################################################
|
||||
|
||||
-- discovery requests performed by the user from the GUI
|
||||
callback_utils.foreachInterface(ifnames, oneshot_discovery_condition, discover_utils.discovery_function)
|
||||
end
|
||||
|
||||
-- ########################################################
|
||||
|
||||
-- discovery requests performed by the user from the GUI
|
||||
callback_utils.foreachInterface(ifnames, oneshot_discovery_condition, discover_utils.discovery_function)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue