mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Handle host pool serialization (exception for backward compatibility).
Fix recipients add Initial work for alerts dispatching to recipients
This commit is contained in:
parent
befc2ec821
commit
7ffb4df9a6
11 changed files with 128 additions and 37 deletions
|
|
@ -16,7 +16,28 @@ local alert_entity_pool_instances = {}
|
|||
|
||||
-- ################################################################################
|
||||
|
||||
-- @brief Returns the host pool of a given `entity_info`
|
||||
-- @brief Returns the pools of a given `entity_id`
|
||||
function pools_alert_utils.get_entity_pools_by_id(entity_id)
|
||||
local alert_entity = alert_consts.alertEntityById(entity_id)
|
||||
|
||||
if not alert_entity then
|
||||
return nil
|
||||
end
|
||||
|
||||
if not alert_entity_pool_instances[alert_entity.entity_id] then
|
||||
if not alert_entity.pools then
|
||||
return nil
|
||||
end
|
||||
local pools = require(alert_entity.pools)
|
||||
alert_entity_pool_instances[alert_entity.entity_id] = pools:create()
|
||||
end
|
||||
|
||||
return alert_entity_pool_instances[alert_entity.entity_id]
|
||||
end
|
||||
|
||||
-- ################################################################################
|
||||
|
||||
-- @brief Returns the pool id of a given `entity_info`
|
||||
function pools_alert_utils.get_entity_pool_id(entity_info)
|
||||
local alert_entity = entity_info.alert_entity
|
||||
local pool_member = entity_info.alert_entity_val
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue