mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Fixed top rrd.lua id
This commit is contained in:
parent
fb751f4277
commit
fc43d660de
3 changed files with 12 additions and 4 deletions
|
|
@ -904,6 +904,11 @@ function driver:timeseries_top(options, top_tags)
|
|||
|
||||
local top_series = {}
|
||||
local count = 0
|
||||
local id = "bytes"
|
||||
|
||||
if ends(options.schema, "packets") then
|
||||
id = "packets"
|
||||
end
|
||||
|
||||
for top_item, value in pairsByValues(available_items, rev) do
|
||||
if value > 0 then
|
||||
|
|
@ -911,15 +916,15 @@ function driver:timeseries_top(options, top_tags)
|
|||
local snmp_cached_dev = require "snmp_cached_dev"
|
||||
local cached_device = snmp_cached_dev:create(options.tags.device)
|
||||
local ifindex = available_tags[top_item][1].if_index
|
||||
local id = shortenString(snmp_utils.get_snmp_interface_label(cached_device["interfaces"][ifindex]), 64)
|
||||
local ext_label = shortenString(snmp_utils.get_snmp_interface_label(cached_device["interfaces"][ifindex]), 64)
|
||||
|
||||
count = table.len(available_series[top_item].data)
|
||||
top_series[#top_series + 1] = {
|
||||
data = available_series[top_item].data,
|
||||
id = "bytes",
|
||||
id = id,
|
||||
type = "line",
|
||||
statistics = available_series[top_item].statistics,
|
||||
ext_label = id
|
||||
ext_label = ext_label
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue