mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Refactors alert_utils and enterprise_alert_utils
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
This commit is contained in:
parent
c83d622ad4
commit
e487427aab
52 changed files with 354 additions and 353 deletions
|
|
@ -6,7 +6,7 @@ dirs = ntop.getDirs()
|
|||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
|
||||
require "lua_utils"
|
||||
require "alert_utils"
|
||||
local alert_utils = require "alert_utils"
|
||||
require "flow_utils"
|
||||
|
||||
local format_utils = require "format_utils"
|
||||
|
|
@ -88,7 +88,7 @@ if alert_options.entity_val ~= nil then
|
|||
alert_options.entity_val = string.gsub(alert_options.entity_val, "https:__", "https://")
|
||||
end
|
||||
|
||||
local alerts, num_alerts = getAlerts(status, alert_options, true --[[ with_counters ]])
|
||||
local alerts, num_alerts = alert_utils.getAlerts(status, alert_options, true --[[ with_counters ]])
|
||||
|
||||
if alerts == nil then alerts = {} end
|
||||
|
||||
|
|
@ -129,11 +129,11 @@ for _key,_value in ipairs(alerts) do
|
|||
column_duration = secondsToTime(tonumber(_value["alert_tstamp_end"]) - tonumber(_value["alert_tstamp"]))
|
||||
end
|
||||
|
||||
local column_severity = alertSeverityLabel(tonumber(_value["alert_severity"]))
|
||||
local column_type = alertTypeLabel(tonumber(_value["alert_type"]))
|
||||
local column_severity = alert_consts.alertSeverityLabel(tonumber(_value["alert_severity"]))
|
||||
local column_type = alert_consts.alertTypeLabel(tonumber(_value["alert_type"]))
|
||||
local column_count = format_utils.formatValue(tonumber(_value["alert_counter"]))
|
||||
local column_score = format_utils.formatValue(tonumber(_value["score"]))
|
||||
local column_msg = string.gsub(formatAlertMessage(ifid, _value), '"', "'")
|
||||
local column_msg = string.gsub(alert_utils.formatAlertMessage(ifid, _value), '"', "'")
|
||||
local column_chart = nil
|
||||
|
||||
if ntop.isPro() then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue