summaryrefslogtreecommitdiffhomepage
path: root/libs/sys/luasrc/sys.lua
diff options
context:
space:
mode:
Diffstat (limited to 'libs/sys/luasrc/sys.lua')
-rw-r--r--libs/sys/luasrc/sys.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/sys/luasrc/sys.lua b/libs/sys/luasrc/sys.lua
index 18622da77..66285249f 100644
--- a/libs/sys/luasrc/sys.lua
+++ b/libs/sys/luasrc/sys.lua
@@ -176,6 +176,9 @@ function sysinfo()
local memfree = tonumber(meminfo:match("MemFree:%s*(%d+)"))
local membuffers = tonumber(meminfo:match("Buffers:%s*(%d+)"))
local bogomips = tonumber(cpuinfo:match("[Bb]ogo[Mm][Ii][Pp][Ss].-: ([^\n]+)")) or 0
+ local swaptotal = tonumber(meminfo:match("SwapTotal:%s*(%d+)"))
+ local swapcached = tonumber(meminfo:match("SwapCached:%s*(%d+)"))
+ local swapfree = tonumber(meminfo:match("SwapFree:%s*(%d+)"))
local system =
cpuinfo:match("system type\t+: ([^\n]+)") or
@@ -190,7 +193,7 @@ function sysinfo()
nixio.uname().machine or
system
- return system, model, memtotal, memcached, membuffers, memfree, bogomips
+ return system, model, memtotal, memcached, membuffers, memfree, bogomips, swaptotal, swapcached, swapfree
end
--- Retrieves the output of the "logread" command.