ntopng/scripts/callbacks/system/daily.lua
Emanuele Faranda 1bf7da7ef7 Implements Mac stats/data reset and reset at midnight (#2326)
* Host data/stats delete improvements

* Rework mac counters and implemtent mac stats/data reset

* Implement stats reset at midnight

* Add missing files
2019-01-21 17:27:12 +01:00

29 lines
755 B
Lua

--
-- (C) 2013-18 - ntop.org
--
local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
require "lua_utils"
local lists_utils = require "lists_utils"
local auth_sessions_utils = require "auth_sessions_utils"
if(ntop.isPro()) then
package.path = dirs.installdir .. "/pro/scripts/callbacks/system/?.lua;" .. package.path
require('daily')
end
-- ########################################################
-- Delete JSON files older than a 30 days
-- TODO: make 30 configurable
harvestJSONTopTalkers(30)
lists_utils.reloadLists()
auth_sessions_utils.midnightCheck()
if ntop.getPref("ntopng.prefs.midnight_stats_reset_enabled") == "1" then
-- Reset host/mac statistics
ntop.resetStats()
end