summaryrefslogtreecommitdiffstats
path: root/health-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'health-model.lua')
-rw-r--r--health-model.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/health-model.lua b/health-model.lua
index 424a0e4..9398b14 100644
--- a/health-model.lua
+++ b/health-model.lua
@@ -65,7 +65,7 @@ mymodule.get_system = function (self)
system.memory.free = math.floor(100 * meminfo["MemFree"] / meminfo["MemTotal"])
system.memory.buffers = math.floor(100 * (meminfo["Buffers"] + meminfo["Cached"]) / meminfo["MemTotal"])
system.memory.used = 100 - math.floor(100 * (meminfo["MemFree"] + meminfo["Buffers"] + meminfo["Cached"]) / meminfo["MemTotal"])
- return cfe({ type="group", value=system })
+ return cfe({ type="group", value=system, label="System" })
end
mymodule.get_storage = function (self)
@@ -105,7 +105,7 @@ mymodule.get_storage = function (self)
end
end
storage.partitions = cfe({ value=fs.read_file("/proc/partitions") or "", label="Partitions" })
- return cfe({ type="group", value=storage })
+ return cfe({ type="group", value=storage, label="Storage" })
end
mymodule.get_network = function (self)
@@ -113,18 +113,18 @@ mymodule.get_network = function (self)
network.interfaces = cfe({ value=querycmd("ip addr"), label="Interfaces" })
network.routes = cfe({ value=querycmd("ip route"), label="Routes" })
network.tunnel = cfe({ value=querycmd("ip tunnel"), label="Tunnels" })
- return cfe({ type="group", value=network })
+ return cfe({ type="group", value=network, label="Network" })
end
mymodule.get_proc = function (self)
local proc = {}
proc.processor = cfe({ value=fs.read_file("/proc/cpuinfo") or "", label="Processor" })
proc.memory = cfe({ value=fs.read_file("/proc/meminfo") or "", label="Memory" })
- return cfe({ type="group", value=proc })
+ return cfe({ type="group", value=proc, label="Hardware Information" })
end
mymodule.get_networkstats = function ()
- local stats = cfe({ type="structure", value={}, label="Network Stats", timestamp=os.time() })
+ local stats = cfe({ type="structure", value={}, label="Network Statistics", timestamp=os.time() })
local result = fs.read_file("/proc/net/dev") or ""
-- parse the result
local i=0