I try to get informations out of the SessionStatistic-table. But I only want the informations of actually logged in users. Therefore I teke the ID's of the ConnectionsList.
The Lua-script works sometimes and sometimes it say "...attempt to index global 'SessStat' (a nil value)!" after printing some values. I do not know what is wrong with this. Here is the part of my script which makes the problem. Can someone help?
Code: Select all
local SessStat = {}
local sessid = 0
local strUserlist = c_GetConnectionsList('Domain')
for nr in pairs(strUserlist) do
sessid = strUserlist[nr].id
SessStat = c_GetSessionStatistic('Domain',sessid)
print(SessStat.down_bytes..'\n')
end