mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Add driver:deleteOldData and delete old RRDs
This commit is contained in:
parent
773df632b4
commit
95713ddfc6
13 changed files with 125 additions and 89 deletions
|
|
@ -698,4 +698,22 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
function driver:deleteOldData(ifid)
|
||||
local paths = getRRDPaths()
|
||||
local dirs = ntop.getDirs()
|
||||
local ifaces = ntop.listInterfaces()
|
||||
local retention_days = tonumber(ntop.getPref("ntopng.prefs.old_rrd_files_retention")) or 365
|
||||
tprint(retention_days)
|
||||
|
||||
for _, path in pairs(paths) do
|
||||
local ifpath = os_utils.fixPath(dirs.workingdir .. "/" .. ifid .. "/".. path .."/")
|
||||
|
||||
ntop.deleteOldRRDs(ifpath, retention_days * 86400)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
||||
return driver
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue