mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Merge pull request #841 from SauroPollastrini/dev
Choice of which alerts has to be notified to Slack based on gravity. Slack related fields on preferences disapperar if Slack notifications are OFF
This commit is contained in:
commit
73d0fc0186
5 changed files with 115 additions and 14 deletions
|
|
@ -210,11 +210,31 @@ function printAlerts()
|
|||
"Off", "0", "danger", -- Off for enabled alerts implies 1 for disable_alerts_generation
|
||||
"toggle_slack_notification", "ntopng.alerts.notification_enabled", "0")
|
||||
|
||||
prefsInputFieldPrefs("Notification Sender Username",
|
||||
"Set the username of the sender of slack notifications", "ntopng.alerts.", "sender_username", "ntopng Webhook", nil, showElements, false)
|
||||
local showSlackNotificationPrefs = false
|
||||
if ntop.getPref("ntopng.alerts.notification_enabled") == "1" then
|
||||
showSlackNotificationPrefs = true
|
||||
else
|
||||
showSlackNotificationPrefs = false
|
||||
end
|
||||
|
||||
prefsInputFieldPrefs("Notification Wekhook",
|
||||
"Send your notification to this slack URL", "ntopng.alerts.", "slack_webhook", "", nil, showElements, true, true)
|
||||
if (showSlackNotificationPrefs) then
|
||||
---[[
|
||||
local labels = {"Errors","Errors and Warnings","All"}
|
||||
local values = {"only_errors","errors_and_warnings","all_alerts"}
|
||||
|
||||
local retVal = multipleTableButtonPrefs("Notification Preference Based On Severity",
|
||||
"Errors (errors only), Errors and Warnings (errors and warnings, no info), All (every kind of alerts will be notified).",
|
||||
labels, values, "only_errors", "primary", "slack_notification_severity_preference", "ntopng.prefs.slack_alert_severity", nil, nil, nil, nil)
|
||||
|
||||
--]]
|
||||
|
||||
prefsInputFieldPrefs("Notification Sender Username",
|
||||
"Set the username of the sender of slack notifications", "ntopng.alerts.", "sender_username", "ntopng Webhook", nil, showElements, false)
|
||||
|
||||
prefsInputFieldPrefs("Notification Wekhook",
|
||||
"Send your notification to this slack URL", "ntopng.alerts.", "slack_webhook", "", nil, showElements, true, true)
|
||||
|
||||
end
|
||||
|
||||
if (ntop.isPro()) then
|
||||
print('<tr><th colspan=2 class="info">Nagios Integration</th></tr>')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue