Clean callback scripts code

This commit is contained in:
emanuele-f 2017-03-04 12:39:48 +01:00
parent e5e6ff6cd8
commit 2affcfb208
6 changed files with 157 additions and 142 deletions

View file

@ -7,14 +7,18 @@ package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
require "lua_utils"
require "alert_utils"
local callback_utils = require "callback_utils"
if (ntop.isPro()) then
package.path = dirs.installdir .. "/pro/scripts/callbacks/?.lua;" .. package.path
require("hourly")
end
-- Scan "hour" alerts
for _, ifname in pairs(interface.getIfNames()) do
scanAlerts("hour", ifname)
end
local verbose = ntop.verboseTrace()
local ifnames = interface.getIfNames()
-- Scan "hour" alerts
callback_utils.foreachInterface(ifnames, verbose, function(ifname, ifstats)
scanAlerts("hour", ifname)
end)