diff options
author | Manuel Munz <freifunk@somakoma.de> | 2013-01-30 13:36:20 +0000 |
---|---|---|
committer | Manuel Munz <freifunk@somakoma.de> | 2013-01-30 13:36:20 +0000 |
commit | 5b129819cc43410341324917a1acb7bd985d73c8 (patch) | |
tree | 44b5a4c72b208e0b09e5f3e095bd79a854a4052e /libs | |
parent | e2b94c2fde1ce6c1e0491f6ec3b85082d3d04c58 (diff) |
modules/admin-full: Add swap info to admin_status page if swap is available, #533
Diffstat (limited to 'libs')
-rw-r--r-- | libs/sys/luasrc/sys.lua | 5 |
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. |