mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 17:30:11 +00:00
29 lines
895 B
Lua
29 lines
895 B
Lua
--
|
|
-- (C) 2019-20 - ntop.org
|
|
--
|
|
|
|
dirs = ntop.getDirs()
|
|
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
|
package.path = dirs.installdir .. "/scripts/lua/modules/timeseries/?.lua;" .. package.path
|
|
local ts_utils = require "ts_utils_core"
|
|
require "ts_5sec"
|
|
local system_utils = require "system_utils"
|
|
local ts_dump = require "ts_5sec_dump_utils"
|
|
local when = os.time()
|
|
|
|
-- ########################################################
|
|
|
|
system_utils.compute_cpu_states()
|
|
|
|
if(ntop.getPref("ntopng.prefs.system_probes_timeseries") ~= "0") then
|
|
local cpu_load = ntop.refreshCpuLoad()
|
|
|
|
if(cpu_load ~= nil) then
|
|
ts_utils.append("system:cpu_load", {ifid = interface.getId(), load_percentage = cpu_load}, when)
|
|
end
|
|
|
|
ts_dump.dump_cpu_states(interface.getId(), when, system_utils.get_cpu_states())
|
|
end
|
|
|
|
-- ########################################################
|
|
|