mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Fix RRD default name for non wildcard tags
This commit is contained in:
parent
931f2c59c7
commit
45769a1fbe
1 changed files with 11 additions and 2 deletions
|
|
@ -55,14 +55,23 @@ local HOST_PREFIX_MAP = {
|
|||
snmp_if = "snmp:",
|
||||
host_pool = "pool:",
|
||||
}
|
||||
local WILDCARD_TAGS = {protocol=1, category=1, l4proto=1}
|
||||
|
||||
local function get_fname_for_schema(schema, tags)
|
||||
if schema.options.rrd_fname ~= nil then
|
||||
return schema.options.rrd_fname
|
||||
end
|
||||
|
||||
-- return the last defined tag
|
||||
return tags[schema._tags[#schema._tags]]
|
||||
local last_tag = schema._tags[#schema._tags]
|
||||
|
||||
if WILDCARD_TAGS[last_tag] then
|
||||
-- return the last defined tag
|
||||
return tags[last_tag]
|
||||
end
|
||||
|
||||
-- e.g. host:contacts -> contacts
|
||||
local suffix = split(schema.name, ":")[2]
|
||||
return suffix
|
||||
end
|
||||
|
||||
local function schema_get_path(schema, tags)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue