Refactors system stats in a module system_utils.lua

This commit is contained in:
Simone Mainardi 2020-02-27 12:24:23 +01:00
parent b194643a18
commit ef06f9e1d3
5 changed files with 35 additions and 4 deletions

View file

@ -10,6 +10,7 @@ local json = require ("dkjson")
local page_utils = require("page_utils")
local tracker = require("tracker")
local storage_utils = require("storage_utils")
local system_utils = require("system_utils")
if not isAllowedSystemInterface() then
sendHTTPContentTypeHeader('text/html')
@ -21,7 +22,7 @@ end
sendHTTPContentTypeHeader('application/json')
local stats = ntop.systemHostStat()
local stats = system_utils.systemHostStats()
stats.epoch = os.time()
stats.storage = storage_utils.storageInfo()