mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Excludes Layer-4 protocols from stacked charts
Layer4 protocols such as UDP and TCP were stacked up along with Layer7 protocols, yielding wrong total traffic values. This commit fixes the issue
This commit is contained in:
parent
1c579b5643
commit
1e99d4b217
1 changed files with 16 additions and 0 deletions
|
|
@ -418,6 +418,16 @@ function isTopRRD(filename)
|
|||
return false
|
||||
end
|
||||
|
||||
function isLayer4RRD(filename)
|
||||
for _, l4 in pairs(l4_keys) do
|
||||
if filename:starts(l4[2]) or filename:starts(l4[1]) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
-- ########################################################
|
||||
|
||||
function printTopRRDs(ifid, host, start_time, baseurl, zoomLevel, selectedEpoch)
|
||||
|
|
@ -1511,6 +1521,12 @@ function rrd2json(ifid, host, rrdFile, start_time, end_time, rickshaw_json, expa
|
|||
d = fixPath(p)
|
||||
rrds = navigatedir("", "*", d, d, go_deep, false, ifid, host, start_time, end_time)
|
||||
|
||||
for key, value in pairs(rrds) do
|
||||
if isLayer4RRD(key) then
|
||||
rrds[key] = nil
|
||||
end
|
||||
end
|
||||
|
||||
local traffic_array = {}
|
||||
for key, value in pairs(rrds) do
|
||||
rsp = singlerrd2json(ifid, host, value, start_time, end_time, rickshaw_json, expand_interface_views)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue