Implemented Report MAC address Traffic Information (#5920)

This commit is contained in:
MatteoBiscosi 2021-09-27 11:59:41 +02:00
parent e9c26b79f8
commit cbfdb7d9cf
2 changed files with 14 additions and 1 deletions

View file

@ -150,6 +150,18 @@ if starts(ts_schema, "custom:") and graph_utils.performCustomQuery then
compare_backward = nil
else
res = performQuery(tstart, tend)
-- if Mac address ts is requested, check if the serialize by mac is enabled and if no data is found, use the host timeseries.
if (res.statistics) and (res.statistics.total == 0) then
local serialize_by_mac = ntop.getPref(string.format("ntopng.prefs.ifid_" .. tags.ifid .. ".serialize_local_broadcast_hosts_as_macs")) == "1"
local tmp = split(ts_schema, ":")
if (serialize_by_mac) and (tags.mac) then
ts_schema = "host:" .. tmp[2]
tags.host = tags.mac .. "_v4"
res = performQuery(tstart, tend)
end
end
end
if res == nil then