mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
parent
dc326eccdf
commit
58a12f1241
8 changed files with 203 additions and 18 deletions
|
|
@ -372,6 +372,31 @@ end
|
|||
|
||||
-- ########################################################
|
||||
|
||||
function ts_dump.update_user_scripts_stats(when, ifstats, verbose)
|
||||
local ifid = ifstats.id
|
||||
|
||||
local all_scripts = {
|
||||
flow = user_scripts.load(user_scripts.script_types.flow, ifid, "flow"),
|
||||
host = user_scripts.load(user_scripts.script_types.traffic_element, ifid, "host"),
|
||||
interface = user_scripts.load(user_scripts.script_types.traffic_element, ifid, "interface"),
|
||||
network = user_scripts.load(user_scripts.script_types.traffic_element, ifid, "network"),
|
||||
syslog = user_scripts.load(user_scripts.script_types.syslog, ifid, "syslog"),
|
||||
}
|
||||
|
||||
for subdir, rv in pairs(all_scripts) do
|
||||
for modkey, modinfo in pairs(rv.modules) do
|
||||
local stats = user_scripts.getAccumulatedStats(ifid, subdir, modkey)
|
||||
|
||||
if(stats) then
|
||||
ts_utils.append("user_script:duration", {ifid = ifstats.id, user_script = modkey, subdir = subdir, num_ms = stats.tot_elapsed * 1000}, when, verbose)
|
||||
ts_utils.append("user_script:num_calls", {ifid = ifstats.id, user_script = modkey, subdir = subdir, num_calls = stats.tot_num_calls}, when, verbose)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- ########################################################
|
||||
|
||||
function ts_dump.host_update_rrd(when, hostname, host, ifstats, verbose, config)
|
||||
-- Crunch additional stats for local hosts only
|
||||
if config.host_rrd_creation ~= "0" then
|
||||
|
|
@ -465,6 +490,8 @@ function ts_dump.run_5min_dump(_ifname, ifstats, config, when, time_threshold, v
|
|||
|
||||
--tprint("Dump of ".. num_processed_hosts .. " hosts: completed in " .. (os.time() - dump_tstart) .. " seconds")
|
||||
|
||||
ts_dump.update_user_scripts_stats(when, ifstats, verbose)
|
||||
|
||||
if is_rrd_creation_enabled then
|
||||
if config.l2_device_rrd_creation ~= "0" then
|
||||
local in_time = callback_utils.foreachDevice(_ifname, time_threshold, function (devicename, device)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue