Host anomalies code cleanup and timeseries dump

This commit is contained in:
Luca Deri 2021-04-10 10:38:26 +02:00
parent bb0b461236
commit 19d6b74457
7 changed files with 24 additions and 39 deletions

View file

@ -55,19 +55,6 @@ end
-- ########################################################
function ts_dump.iface_update_rrds(when, ifstats, verbose)
local anomalies_info = interface.getAnomalies()
anomalies_info = anomalies_info["anomalies"]
local anomalies_counter = (anomalies_info["tot_num_anomalies"]["local_hosts"] + anomalies_info["tot_num_anomalies"]["remote_hosts"]) - (anomalies_info["tot_num_old_anomalies"]["local_hosts"] + anomalies_info["tot_num_old_anomalies"]["remote_hosts"])
-- Save total anomalies delta counter
ts_utils.append("iface:anomalies", {ifid=ifstats.id, anomalies=anomalies_counter}, when)
end
-- ########################################################
function ts_dump.asn_update_rrds(when, ifstats, verbose)
local asn_info = interface.getASesInfo({detailsLevel = "higher"})
@ -646,8 +633,6 @@ function ts_dump.run_5min_dump(_ifname, ifstats, config, when)
end
end
ts_dump.iface_update_rrds(when, ifstats, verbose)
-- create RRD for ASN
if config.asn_rrd_creation == "1" then
ts_dump.asn_update_rrds(when, ifstats, verbose)