Implement host timeseries off/light/mode selection

Closes #3466
This commit is contained in:
emanuele-f 2020-03-03 15:52:04 +01:00
parent 4c103b8e52
commit 0facf0e27d
8 changed files with 40 additions and 41 deletions

View file

@ -3446,14 +3446,17 @@ function areInterfaceCategoriesTimeseriesEnabled(ifid)
end
function areHostTimeseriesEnabled(ifid)
return(arePerInterfaceTsEnabled(ifid) and (ntop.getPref("ntopng.prefs.host_rrd_creation") ~= "0"))
local rv = ntop.getPref("ntopng.prefs.hosts_ts_creation")
if isEmptyString(rv) then rv = "light" end
return((rv == "light") or (rv == "full"))
end
function areHostL7TimeseriesEnabled(ifid)
local rv = ntop.getPref("ntopng.prefs.host_ndpi_timeseries_creation")
-- note: host protocols are disabled by default
return(areHostTimeseriesEnabled(ifid) and
return((ntop.getPref("ntopng.prefs.hosts_ts_creation") == "full") and
((rv == "per_protocol") or (rv == "both")))
end
@ -3461,7 +3464,7 @@ function areHostCategoriesTimeseriesEnabled(ifid)
local rv = ntop.getPref("ntopng.prefs.host_ndpi_timeseries_creation")
-- note: host protocols are disabled by default
return(areHostTimeseriesEnabled(ifid) and
return((ntop.getPref("ntopng.prefs.hosts_ts_creation") == "full") and
((rv == "per_category") or (rv == "both")))
end