mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Implements user script for remote to remote host alerts
Addresses #4614
This commit is contained in:
parent
8ca7daf889
commit
cbfd2c8025
5 changed files with 83 additions and 37 deletions
|
|
@ -5,23 +5,23 @@
|
|||
-- #######################################################
|
||||
|
||||
local alert_keys = require "alert_keys"
|
||||
-- @brief Prepare an alert table used to generate the alert
|
||||
-- @param alert_severity A severity as defined in `alert_consts.alert_severities`
|
||||
-- @return A table with the alert built
|
||||
local function createRemoteToRemote(alert_severity)
|
||||
local built = {
|
||||
alert_severity = alert_severity,
|
||||
alert_type_params = {},
|
||||
}
|
||||
|
||||
return built
|
||||
-- #######################################################
|
||||
|
||||
local function formatRemoteToRemoteMessage(ifid, alert, remote_to_remote_info)
|
||||
local alert_consts = require("alert_consts")
|
||||
local entity = alert_consts.formatAlertEntity(ifid, alert_consts.alertEntityRaw(alert["alert_entity"]), alert["alert_entity_val"])
|
||||
|
||||
return i18n("alert_messages.remote_to_remote", {
|
||||
entity = entity,
|
||||
})
|
||||
end
|
||||
|
||||
-- #######################################################
|
||||
|
||||
return {
|
||||
alert_key = alert_keys.ntopng.alert_remote_to_remote,
|
||||
i18n_title = "alerts_dashboard.remote_to_remote",
|
||||
icon = "fas fa-exclamation",
|
||||
creator = createRemoteToRemote
|
||||
alert_key = alert_keys.ntopng.alert_remote_to_remote,
|
||||
i18n_title = "alerts_dashboard.remote_to_remote",
|
||||
i18n_description = formatRemoteToRemoteMessage,
|
||||
icon = "fas fa-exclamation",
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue