add overlay usage to statistics.d

This commit is contained in:
ohrensessel 2014-08-18 11:40:13 +02:00
parent 6421f01502
commit c64fbd8140
1 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,7 @@
local fs = require "nixio.fs"
local opkg = require "luci.model.ipkg"
local st = fs.statvfs(opkg.overlay_root())
local used = 100*((st.blocks - st.bfree) / st.blocks) or 0
return math.floor(used * 1000 + 0.5) / 1000