Implements custom timeseries

This commit is contained in:
Simone Mainardi 2019-02-22 15:41:41 +01:00
parent 65bc5261de
commit 0cd3d5be63
4 changed files with 89 additions and 0 deletions

View file

@ -6,6 +6,12 @@ local callback_utils = require "callback_utils"
local ts_utils = require "ts_utils_core"
require "ts_5min"
local ts_custom
if ntop.exists(dirs.installdir .. "/scripts/lua/modules/timeseries/custom/ts_5min_custom.lua") then
package.path = dirs.installdir .. "/scripts/lua/modules/timeseries/custom/?.lua;" .. package.path
ts_custom = require "ts_5min_custom"
end
local dirs = ntop.getDirs()
local ts_dump = {}
@ -197,6 +203,11 @@ function ts_dump.host_update_stats_rrds(when, hostname, host, ifstats, verbose)
--io.write("Discarding "..k.."@"..hostname.."\n")
end
end
-- create custom rrds
if ts_custom and ts_custom.host_update_stats then
ts_custom.host_update_stats(when, hostname, host, ifstats, verbose)
end
end
function ts_dump.host_update_ndpi_rrds(when, hostname, host, ifstats, verbose)