Add flow/alerts definitions directories

This commit is contained in:
emanuele-f 2019-10-16 17:45:55 +02:00
parent 9386fdd2b1
commit 6533175336
5 changed files with 23 additions and 4 deletions

View file

@ -124,13 +124,19 @@ end
-- ##############################################
function alert_consts.getDefinititionsDir()
return(os_utils.fixPath(dirs.installdir .. "/scripts/callbacks/alert_defs"))
end
-- ##############################################
-- NOTE: flow alerts are formatted based on their status. See flow_consts.status_types.
alert_consts.alert_types = {}
local alerts_by_id = {}
local function loadAlertsDefs()
local dirs = ntop.getDirs()
local defs_dir = os_utils.fixPath(dirs.installdir .. "/scripts/callbacks/alert_defs")
local defs_dir = alert_consts.getDefinititionsDir()
package.path = defs_dir .. "/?.lua;" .. package.path
local required_fields = {"alert_id", "i18n_title", "icon"}