mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-01 00:19:33 +00:00
* Add lowerbound and percentage threshold on host rules. (#6855) * Add interface rules. (#6855) * Added ability to blacklist hosts via Lua API * Not supposed to be committed * Method signature change to be called it also from a lua host script * Fix empty string heck * Add param check * Add example listing alerts * Fix params check * Fix alert raw queris * Removed debug code * MacOS changes * Updated (C) * Warning fixes * Removed sprintf calls * Added rx_only_hosts classification * https://github.com/ntop/ntopng/issues/7233; extend datatable component to allow external vue components in table menu bar * Update dist: https://github.com/ntop/ntopng/issues/7233; extend datatable component to allow external vue components in table menu bar * Remove obsoleted comment * Minor GUI fix. (#6855) * Fix on alert format. (#6855) * Minor fix. (#6855) * Update doc. (#6855) --------- Co-authored-by: Luca Deri <lucaderi@users.noreply.github.com> Co-authored-by: Luca Deri <deri@ntop.org> Co-authored-by: Alfredo Cardigliano <cardigliano@ntop.org> Co-authored-by: uccidibuti <vannucci@ntop.org>
This commit is contained in:
parent
9618eee614
commit
cf8a89a7e1
15 changed files with 389 additions and 164 deletions
|
|
@ -651,31 +651,60 @@ end
|
|||
|
||||
-- #################################
|
||||
|
||||
function timeseries_info.get_host_rules_schema()
|
||||
local host_ts_enabled = ntop.getCache("ntopng.prefs.host_ndpi_timeseries_creation")
|
||||
local has_top_protocols = host_ts_enabled == "both" or host_ts_enabled == "per_protocol" or host_ts_enabled ~= "0"
|
||||
local has_top_categories = host_ts_enabled == "both" or host_ts_enabled == "per_category"
|
||||
function timeseries_info.get_host_rules_schema(is_interface)
|
||||
if not is_interface then
|
||||
local host_ts_enabled = ntop.getCache("ntopng.prefs.host_ndpi_timeseries_creation")
|
||||
local has_top_protocols = host_ts_enabled == "both" or host_ts_enabled == "per_protocol" or host_ts_enabled ~= "0"
|
||||
local has_top_categories = host_ts_enabled == "both" or host_ts_enabled == "per_category"
|
||||
|
||||
local metric_list = {
|
||||
{ title = i18n('traffic'), group = i18n('generic_data'), label = i18n('traffic'), id = 'host:traffic' --[[ here the ID is the schema ]], show_volume = true },
|
||||
{ title = i18n('score'), group = i18n('generic_data'), label = i18n('score'), id = 'host:score' --[[ here the ID is the schema ]], show_volume = false },
|
||||
}
|
||||
local metric_list = {
|
||||
{ title = i18n('traffic'), group = i18n('generic_data'), label = i18n('traffic'), id = 'host:traffic' --[[ here the ID is the schema ]], show_volume = true },
|
||||
{ title = i18n('score'), group = i18n('generic_data'), label = i18n('score'), id = 'host:score' --[[ here the ID is the schema ]], show_volume = false },
|
||||
}
|
||||
|
||||
if has_top_protocols then
|
||||
local application_list = interface.getnDPIProtocols()
|
||||
for application, _ in pairsByKeys(application_list or {}, asc) do
|
||||
metric_list[#metric_list + 1] = { label = application, group = i18n('applications_long'), title = application, id = 'top:host:ndpi', extra_metric = 'protocol:' .. application --[[ here the schema is the ID ]], show_volume = true }
|
||||
if has_top_protocols then
|
||||
local application_list = interface.getnDPIProtocols()
|
||||
for application, _ in pairsByKeys(application_list or {}, asc) do
|
||||
metric_list[#metric_list + 1] = { label = application, group = i18n('applications_long'), title = application, id = 'top:host:ndpi', extra_metric = 'protocol:' .. application --[[ here the schema is the ID ]], show_volume = true }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if has_top_categories then
|
||||
local category_list = interface.getnDPICategories()
|
||||
for category, _ in pairsByKeys(category_list or {}, asc) do
|
||||
metric_list[#metric_list + 1] = { label = category, group = i18n('categories'), title = category, id = 'top:host:ndpi_categories', extra_metric = 'category:' .. category --[[ here the schema is the ID ]], show_volume = true }
|
||||
if has_top_categories then
|
||||
local category_list = interface.getnDPICategories()
|
||||
for category, _ in pairsByKeys(category_list or {}, asc) do
|
||||
metric_list[#metric_list + 1] = { label = category, group = i18n('categories'), title = category, id = 'top:host:ndpi_categories', extra_metric = 'category:' .. category --[[ here the schema is the ID ]], show_volume = true }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return metric_list
|
||||
|
||||
return metric_list
|
||||
else
|
||||
local ifname_ts_enabled = ntop.getCache("ntopng.prefs.ifname_ndpi_timeseries_creation")
|
||||
local has_top_protocols = ifname_ts_enabled == "both" or ifname_ts_enabled == "per_protocol" or ifname_ts_enabled ~= "0"
|
||||
local has_top_categories = ifname_ts_enabled == "both" or ifname_ts_enabled == "per_category"
|
||||
|
||||
local metric_list = {
|
||||
{ title = i18n('traffic'), group = i18n('generic_data'), label = i18n('traffic'), id = 'iface:traffic' --[[ here the ID is the schema ]], show_volume = true },
|
||||
{ title = i18n('score'), group = i18n('generic_data'), label = i18n('score'), id = 'iface:score' --[[ here the ID is the schema ]], show_volume = false },
|
||||
}
|
||||
|
||||
if has_top_protocols then
|
||||
local application_list = interface.getnDPIProtocols()
|
||||
for application, _ in pairsByKeys(application_list or {}, asc) do
|
||||
metric_list[#metric_list + 1] = { label = application, group = i18n('applications_long'), title = application, id = 'top:iface:ndpi', extra_metric = 'protocol:' .. application --[[ here the schema is the ID ]], show_volume = true }
|
||||
end
|
||||
end
|
||||
|
||||
if has_top_categories then
|
||||
local category_list = interface.getnDPICategories()
|
||||
for category, _ in pairsByKeys(category_list or {}, asc) do
|
||||
metric_list[#metric_list + 1] = { label = category, group = i18n('categories'), title = category, id = 'top:iface:ndpi_categories', extra_metric = 'category:' .. category --[[ here the schema is the ID ]], show_volume = true }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return metric_list
|
||||
end
|
||||
end
|
||||
|
||||
-- #################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue