ntopng/scripts/lua/modules/alert_definitions/alert_host_pool_disconnection.lua
2020-12-23 11:46:26 +01:00

46 lines
1.3 KiB
Lua

--
-- (C) 2019-20 - ntop.org
--
-- ##############################################
local alert_keys = require "alert_keys"
local alert_creators = require "alert_creators"
-- Import the classes library.
local classes = require "classes"
-- Make sure to import the Superclass!
local alert = require "alert"
-- ##############################################
local alert_host_pool_disconnection = classes.class(alert)
-- ##############################################
alert_host_pool_disconnection.meta = {
alert_key = alert_keys.ntopng.alert_host_pool_disconnection,
i18n_title = "alerts_dashboard.host_pool_disconnection",
icon = "fas fa-sign-out",
}
-- ##############################################
function alert_host_pool_disconnection:init(pool)
-- Call the paren constructor
self.super:init()
self.alert_type_params = alert_creators.createPoolConnectionDisconnection(pool)
end
-- #######################################################
function alert_host_pool_disconnection.format(ifid, alert, alert_type_params)
return(i18n("alert_messages.host_pool_has_disconnected", {
pool = alert_type_params.pool,
url = getHostPoolUrl(alert.alert_entity_val),
}))
end
-- #######################################################
return alert_host_pool_disconnection