module(..., package.seeall) -- Load libraries require("modelfunctions") require("fs") require("format") -- Set variables local processname = "lvm" local packagename = "lvm2" local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin " -- ################################################################################ -- LOCAL FUNCTIONS -- ################################################################################ -- PUBLIC FUNCTIONS function startstop_service(action) return modelfunctions.startstop_service(processname, action) end function getstatus() return modelfunctions.getstatus(processname, packagename, "LVM Status") end function getstatusdetails() local status = {} status.pvdisplay = cfe({ type="longtext", label="Physical Volumes" }) local cmd = path .. "pvdisplay" local f = io.popen(cmd) status.pvdisplay.value = f:read("*a") or "" f:close() status.lvdisplay = cfe({ type="longtext", label="Logical Volumes" }) cmd = path .. "lvdisplay" f = io.popen(cmd) status.lvdisplay.value = f:read("*a") or "" f:close() return cfe({ type="group", value=status, label="LVM Status Details" }) end