Added L7 iface proto behavior analysis and alert (#5499 #5474)

This commit is contained in:
MatteoBiscosi 2021-06-29 16:50:36 +02:00
parent 93b7d1db7b
commit be198c2a99
20 changed files with 264 additions and 77 deletions

View file

@ -762,13 +762,14 @@ function printNetworkBehaviour()
-- ######################
print('<thead class="table-primary"><tr><th colspan=2 class="info">'..i18n("prefs.behaviour")..'</th></tr></thead>')
print('<thead class="table-primary"><tr><th colspan=2 class="info">'..i18n("prefs.traffic_behaviour")..'</th></tr></thead>')
-- Behavior analysis for asn, network and l7proto (iface)
prefsToggleButton(subpage_active, {
field = "toggle_behaviour_analysis",
default = "0",
pref = "is_behaviour_analysis_enabled", -- redis preference
to_switch = {"learning-status-thead", "behaviour_analysis_learning_period", "row_behaviour_analysis_learning_status_during_learning", "row_behaviour_analysis_learning_status_post_learning", "iec60870_learning_period"},
to_switch = {"learning-status-thead", "behaviour_analysis_learning_period", "row_behaviour_analysis_learning_status_during_learning", "row_behaviour_analysis_learning_status_post_learning"},
})
local is_behaviour_analysis_enabled = ntop.getPref("ntopng.prefs.is_behaviour_analysis_enabled") == "1"
@ -811,6 +812,27 @@ function printNetworkBehaviour()
prefs.iec60870_learning_period,
"number", nil, nil, nil, {min=21600, tformat="hd"})
print('<thead class="table-primary"><tr><th colspan=2 class="info">'..i18n('prefs.behavior_timeseries')..'</th></tr></thead>')
prefsToggleButton(subpage_active, {
field = "toggle_asn_behavior_analysis",
default = "0",
pref = "is_asn_behavior_analysis_enabled", -- redis preference
})
prefsToggleButton(subpage_active, {
field = "toggle_network_behavior_analysis",
default = "0",
pref = "is_network_behavior_analysis_enabled", -- redis preference
})
prefsToggleButton(subpage_active, {
field = "toggle_iface_l7_behavior_analysis",
default = "0",
pref = "is_iface_l7_behavior_analysis_enabled", -- redis preference
})
-- #####################
print('<tr><th colspan=2 style="text-align:right;"><button type="submit" class="btn btn-primary" style="width:115px" disabled="disabled">'..i18n("save")..'</button></th></tr>')