Add aggregated flows data retention. (#7497)

This commit is contained in:
Nicolo Maio 2023-05-31 08:48:35 +00:00
parent c8bbb0196b
commit 73ea3b6dfc
5 changed files with 50 additions and 6 deletions

View file

@ -7,6 +7,7 @@ package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
local DEFAULT_DATA_RETENTION_DAYS = 30
local DEFAULT_AGGREGATED_FLOWS_DATA_RETENTION_DAYS = 60
local DEFAULT_DATA_RETENTION_DAYS_KEY = "ntopng.prefs.data_retention_days"
local FLOWS_AND_ALERTS_DATA_RETENTION_DAYS_KEY = "ntopng.prefs.flows_and_alerts_data_retention_days"
local TS_AND_STATS_DATA_RETENTION_DAYS_KEY = "ntopng.prefs.ts_and_stats_data_retention_days"
@ -21,6 +22,12 @@ end
-- ########################################################
function data_retention_utils.getAggregatedFlowsDataRetention()
return DEFAULT_AGGREGATED_FLOWS_DATA_RETENTION_DAYS
end
-- ########################################################
function data_retention_utils.getFlowsAndAlertsDataRetentionDays()
local data_retention = ntop.getCache(FLOWS_AND_ALERTS_DATA_RETENTION_DAYS_KEY) or ntop.getCache(DEFAULT_DATA_RETENTION_DAYS_KEY)