ntopng/scripts/callbacks/interface/flow/web_mining.lua
emanuele-f b3a8c6d49a Migrate C flow status alerts to Lua user scripts
- Alerts and flow status cleanup
- Community flow user scripts migration
- Implement scripts filters by l7 proto and packet interface only
- Migrate flow2statusinfojson
- Lower flow periodic update to 30 seconds if there is flow activity
- Display flow scripts without a gui section
2019-10-22 10:42:22 +02:00

35 lines
796 B
Lua

--
-- (C) 2019 - ntop.org
--
local flow_consts = require("flow_consts")
-- #################################################################
local script = {
key = "web_mining",
-- NOTE: hooks defined below
hooks = {},
}
-- #################################################################
function script.setup()
local enabled = (ntop.getPref("ntopng.prefs.mining_alerts") == "1")
return(enabled)
end
-- #################################################################
function script.hooks.protocolDetected(params)
local info = params.flow_info
if(info["proto.ndpi_cat"] == "Mining") then
flow.triggerStatus(flow_consts.status_types.status_web_mining_detected.status_id)
end
end
-- #################################################################
return script