mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Rework flow scripts into user scripts
This commit is contained in:
parent
8ceacb37f6
commit
52d2051d4c
9 changed files with 187 additions and 109 deletions
42
scripts/callbacks/user_scripts/periodic/default.lua
Normal file
42
scripts/callbacks/user_scripts/periodic/default.lua
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
--
|
||||
-- (C) 2016-17 - ntop.org
|
||||
--
|
||||
|
||||
--
|
||||
-- NOTE: You should *NOT* delete/edit this file. Create a new file in this directory instead.
|
||||
--
|
||||
|
||||
-- ########################################################
|
||||
--
|
||||
-- < Lua Virtual Machine - periodic >
|
||||
--
|
||||
-- The callbacks listed below are executed periodically.
|
||||
-- Usually these callbacks cannot modify internal objects status because of
|
||||
-- missing thread synchronization logic.
|
||||
--
|
||||
-- ########################################################
|
||||
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
require("lua_utils")
|
||||
|
||||
-- Enable debug here
|
||||
local trace_enabled = false
|
||||
|
||||
local callbacks = {}
|
||||
|
||||
-- ########################################################
|
||||
|
||||
--
|
||||
-- This callback is called periodically for all active flows
|
||||
-- Add here housekeeping of periodic activities you want to
|
||||
-- perform in a flow.
|
||||
-- Flow callbacks can be accesed via "flow" register.
|
||||
--
|
||||
function callbacks.flowUpdate()
|
||||
if(trace_enabled) then print("flowUpdate()\n") end
|
||||
end
|
||||
|
||||
-- ########################################################
|
||||
|
||||
return callbacks
|
||||
Loading…
Add table
Add a link
Reference in a new issue