projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
modules/admin-full: Add swap info to admin_status page if swap is available, #533
[project/luci.git]
/
libs
/
sys
/
luasrc
/
sys.lua
diff --git
a/libs/sys/luasrc/sys.lua
b/libs/sys/luasrc/sys.lua
index
18622da
..
6628524
100644
(file)
--- 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 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
local system =
cpuinfo:match("system type\t+: ([^\n]+)") or
@@
-190,7
+193,7
@@
function sysinfo()
nixio.uname().machine or
system
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.
end
--- Retrieves the output of the "logread" command.