ntopng/scripts/callbacks/system/second/cpu.lua
2019-07-05 16:26:33 +02:00

22 lines
449 B
Lua

--
-- (C) 2013-19 - ntop.org
--
local probe = {
name = "CPU",
descripton = "Monitors the CPU usage",
}
-- ##############################################
function probe.runTask(when, ts_utils)
local cpu_load = ntop.refreshCpuLoad()
if(cpu_load ~= nil) then
ts_utils.append("system:cpu_load", {ifid = getSystemInterfaceId(), load_percentage = cpu_load}, when)
end
end
-- ##############################################
return probe