Implemented ASN traffic rules (#9531)

This commit is contained in:
Manuel Ceroni 2025-08-19 23:17:25 +02:00 committed by GitHub
parent 8ffa33cf6b
commit 5e48729f68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 221 additions and 5 deletions

View file

@ -3712,6 +3712,19 @@ function timeseries_info.get_traffic_rules_schema(rule_type)
end
end
return metric_list
elseif rule_type == "asn" then
local metric_list = {}
for _, item in ipairs(community_timeseries) do
if (item.id == timeseries_id.asn) then
-- When the custom threshold is added, remove this check to use all time series
if(item.schema == "asn:traffic_rcvd" or
item.schema == "asn:traffic_sent" or
item.schema == "asn:traffic") then
metric_list[#metric_list + 1] = item
end
end
end
return metric_list
elseif rule_type == "interface" then
local ifname_ts_enabled = ntop.getCache(