mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
35 lines
1.1 KiB
Lua
35 lines
1.1 KiB
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
|
|
|
|
-- ########################################################
|
|
|
|
if ntop.getPref("ntopng.prefs.internals_rrd_creation") == "1" then
|
|
ts_dump.update_rrd_queue_length(interface.getId(), when)
|
|
end
|
|
|
|
-- ########################################################
|
|
|