Escapes possible spaces and special charaters from profile names to create RRDS

This commit is contained in:
Simone Mainardi 2015-11-09 20:14:34 +01:00
parent c839e85d6e
commit 83574e1a9d
3 changed files with 21 additions and 6 deletions

View file

@ -71,7 +71,7 @@ for _,_ifname in pairs(ifnames) do
if ntop.isPro() and ifstats.profiles then -- profiles are only available in the Pro version
basedir = fixPath(dirs.workingdir .. "/" .. ifstats.id..'/profilestats')
for pname, ptraffic in pairs(ifstats.profiles) do
local rrdpath = fixPath(basedir.. "/" .. pname)
local rrdpath = fixPath(basedir.. "/" .. getPathFromKey(trimSpace(pname)))
if(not(ntop.exists(rrdpath))) then
ntop.mkdir(rrdpath)
end