Splitted traffic directions in iface ndpi timeseries (#9137)

This commit is contained in:
Matteo Biscosi 2025-05-28 12:47:48 +02:00
parent 6fb4cdc448
commit a5f89e6357
17 changed files with 2203 additions and 2077 deletions

View file

@ -25,16 +25,25 @@ local ts_dump = {}
function ts_dump.iface_update_ndpi_rrds(when, _ifname, ifstats, verbose, config)
for k in pairs(ifstats["ndpi"]) do
local v = ifstats["ndpi"][k]["bytes.sent"] + ifstats["ndpi"][k]["bytes.rcvd"]
if (verbose) then
print("[" .. __FILE__() .. ":" .. __LINE__() .. "] " .. _ifname .. ": " .. k .. "=" .. v .. "\n")
end
if config.interface_ndpi_timeseries_full then
ts_utils.append("iface:ndpi_full", {
ifid = ifstats.id,
protocol = k,
bytes_sent = ifstats["ndpi"][k]["bytes.sent"],
bytes_rcvd = ifstats["ndpi"][k]["bytes.rcvd"]
}, when)
else
local v = ifstats["ndpi"][k]["bytes.sent"] + ifstats["ndpi"][k]["bytes.rcvd"]
if (verbose) then
print("[" .. __FILE__() .. ":" .. __LINE__() .. "] " .. _ifname .. ": " .. k .. "=" .. v .. "\n")
end
ts_utils.append("iface:ndpi", {
ifid = ifstats.id,
protocol = k,
bytes = v
}, when)
ts_utils.append("iface:ndpi", {
ifid = ifstats.id,
protocol = k,
bytes = v
}, when)
end
if config.ndpi_flows_timeseries_creation == "1" then
ts_utils.append("iface:ndpi_flows", {