mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Adds optional JSON syslog alert format
This commit is contained in:
parent
603bc2d31c
commit
a86239fac3
5 changed files with 61 additions and 8 deletions
|
|
@ -536,13 +536,34 @@ function printExternalAlertsReport()
|
|||
if ntop.syslog then
|
||||
print('<tr><th colspan="2" class="info">'..i18n("prefs.syslog_notification")..'</th></tr>')
|
||||
|
||||
local alertsEnabled = showElements
|
||||
local elementToSwitch = {"row_syslog_alert_format"}
|
||||
|
||||
prefsToggleButton({
|
||||
field = "toggle_alert_syslog",
|
||||
pref = getAlertNotificationModuleEnableKey("syslog", true),
|
||||
default = "0",
|
||||
disabled = showElements == false,
|
||||
disabled = alertsEnabled == false,
|
||||
to_switch = elementToSwitch,
|
||||
})
|
||||
|
||||
local format_labels = {i18n("prefs.syslog_alert_format_plaintext"), i18n("prefs.syslog_alert_format_json")}
|
||||
local format_values = {"plaintext", "json"}
|
||||
|
||||
if ntop.getPref(getAlertNotificationModuleEnableKey("syslog")) == "0" then
|
||||
alertsEnabled = false
|
||||
end
|
||||
|
||||
|
||||
retVal = multipleTableButtonPrefs(subpage_active.entries["syslog_alert_format"].title,
|
||||
subpage_active.entries["syslog_alert_format"].description,
|
||||
format_labels, format_values,
|
||||
"plaintext",
|
||||
"primary",
|
||||
"syslog_alert_format",
|
||||
"ntopng.prefs.syslog_alert_format", nil,
|
||||
nil, nil, nil, alertsEnabled)
|
||||
|
||||
end
|
||||
|
||||
if(ntop.isPro() and hasNagiosSupport()) then
|
||||
|
|
@ -558,7 +579,7 @@ function printExternalAlertsReport()
|
|||
field = "toggle_alert_nagios",
|
||||
pref = getAlertNotificationModuleEnableKey("nagios", true),
|
||||
default = "0",
|
||||
disabled = alertsEnabled==false,
|
||||
disabled = alertsEnabled == false,
|
||||
to_switch = elementToSwitch,
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue