mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-01 00:19:33 +00:00
Addresses #3720 Alerts Refactor: alert_utils as module Alerts Refactor: notify_ntopng_start and notify_ntopng_stop Alerts Refactor: processAlertNotifications Alerts Refactor: checkStoreAlertsFromC Alerts Refactor: formatAlertNotification Alerts Refactor: notification_timestamp_rev Alerts Refactor: formatAlertMessage Alerts Refactor: getConfigsetAlertLink Alerts Refactor: alertNotificationActionToLabel Alerts Refactor: flushAlertsData Alerts Refactor: disableAlertsGeneration Alerts Refactor: newAlertsWorkingStatus and other Alerts Refactor: drawAlerts Alerts Refactor: drawAlertTables Alerts Refactor: printAlertTables Alerts Refactor: checkDeleteStoredAlerts Alerts Refactor: getUnpagedAlertOptions Alerts Refactor: getTabParameters Alerts Refactor: getAlerts Alerts Refactor: getNumAlerts Alerts Refactor: performAlertsQuery Alerts Refactor: sec2granularity Alerts Refactor: granularity2id Alerts Refactor: granularity2sec Alerts Refactor: alertEngineLabel Alerts Refactor: alertEngine Alerts Refactor: alertEngineRaw Alerts Refactor: alertTypeDescription Alerts Refactor: alertType Alerts Refactor: alertTypeLabel Alerts Refactor: alertTypeRaw Alerts Refactor: alertSeverity Alerts Refactor: alertSeverityLabel Alerts Refactor: alertSeverityRaw Alerts Refactor: get_make_room_keys Alerts Refactor: enterprise_alert_utils
44 lines
1.3 KiB
Lua
44 lines
1.3 KiB
Lua
--
|
|
-- (C) 2013-20 - ntop.org
|
|
--
|
|
|
|
local dirs = ntop.getDirs()
|
|
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
|
|
|
require "lua_utils"
|
|
local alert_utils = require "alert_utils"
|
|
|
|
local callback_utils = require "callback_utils"
|
|
local db_utils = require "db_utils"
|
|
local ts_utils = require "ts_utils"
|
|
local data_retention_utils = require "data_retention_utils"
|
|
local user_scripts = require("user_scripts")
|
|
|
|
if(ntop.isPro()) then
|
|
package.path = dirs.installdir .. "/pro/scripts/callbacks/interface/?.lua;" .. package.path
|
|
require('daily')
|
|
end
|
|
|
|
-- ########################################################
|
|
|
|
local verbose = ntop.verboseTrace()
|
|
local ifstats = interface.getStats()
|
|
local _ifname = ifstats.name
|
|
|
|
-- ########################################################
|
|
|
|
local interface_id = getInterfaceId(_ifname)
|
|
|
|
user_scripts.runPeriodicScripts("day")
|
|
|
|
local data_retention = data_retention_utils.getDataRetentionDays()
|
|
|
|
ntop.deleteMinuteStatsOlderThan(interface_id, data_retention)
|
|
|
|
if ntop.getPrefs()["is_dump_flows_to_mysql_enabled"] and not ifstats.isViewed then
|
|
local mysql_retention = os.time() - 86400 * data_retention
|
|
db_utils.harverstExpiredMySQLFlows(_ifname, mysql_retention, verbose)
|
|
end
|
|
|
|
ts_utils.deleteOldData(interface_id)
|
|
alert_utils.optimizeAlerts()
|