mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Plugins are a convenient way to group together related lua scripts. Their primary use case is to group user scripts and their alert/status definition. The builtin ntopng user scripts and definitions are now packed into plugins directories. In future, we will support loading of user created plugins. Plugins are loaded at startup into some runtime directories and then used. Other changes provided by this commit include: - Add sample flow logger plugin - Initial support for system user scripts - Rename edge to threshold - Migrate system probes to user scripts/plugins - Migrate scripts to more explicit alerts_api.checkThresholdAlert api
25 lines
871 B
Lua
25 lines
871 B
Lua
--
|
|
-- (C) 2019 - ntop.org
|
|
--
|
|
|
|
local function formatMisconfiguredApp(ifid, alert, threshold_info)
|
|
local alert_consts = require("alert_consts")
|
|
local entity = alert_consts.formatAlertEntity(ifid, alert_consts.alertEntityRaw(alert["alert_entity"]), alert["alert_entity_val"])
|
|
|
|
if alert.alert_subtype == "too_many_flows" then
|
|
return(i18n("alert_messages.too_many_flows", {iface=entity, option="--max-num-flows/-X"}))
|
|
elseif alert.alert_subtype == "too_many_hosts" then
|
|
return(i18n("alert_messages.too_many_hosts", {iface=entity, option="--max-num-hosts/-x"}))
|
|
else
|
|
return("Unknown app misconfiguration: " .. (alert.alert_subtype or ""))
|
|
end
|
|
end
|
|
|
|
-- #######################################################
|
|
|
|
return {
|
|
alert_id = 15,
|
|
i18n_title = "alerts_dashboard.misconfigured_app",
|
|
icon = "fa-cog",
|
|
i18n_description = formatMisconfiguredApp,
|
|
}
|