{
    "name"  : "会话数检查",
    "problems" : {
        "sessionNumber" : {
            "desc"      : "【问题】有用户流会话数接近或达到限制值",
            "advice"    : "【建议】有用户流会话数接近或达到限制值，建议排查该用户是否有攻击行为，或提高会话数限制数值"
        },
        "sessionNumberLittle" : {
            "desc"      : "【问题】整机/单ip/指定用户组的会话数限制可能不合理（太小）",
            "advice"    : "【建议】每ip会话数限制设置太小导致用户上网异常。建议每ip会话数限制根据实际情况调整大小，最小不要小于1000。"
        }
    }
}
---------------------------code-------------------------------
res = cli("show flow-pre-mgr ip-info")
print res
resArr = res.split(/\r?\n/)
print resArr
print resArr.length
i = 3
count = 0
while i < (resArr.length - 1):    
    resSignalArr = resArr[i]
    resSignalArr = resSignalArr.trim()
    resSignalArr = resSignalArr.split(/\s+/)
    flow_limit = resSignalArr[2]
    flow_cnt = resSignalArr[1]
	tmp = flow_cnt*1.0/flow_limit
    if flow_limit == 0 && flow_cnt > 20000 :
        add_problem("sessionNumber")
		print 'warn'
        return 'warn'
    end
    if tmp > 0.99:
        count = count + 1
		print count
    end
    if count > 10:
        add_problem("sessionNumber")
		print 'warn'
        return 'warn'
    end
    
    if flow_limit > 0 && flow_limit < 200:
        add_problem("sessionNumberLittle")
		print 'warn'
        return 'warn'      
    end
    i = i + 1
end
print 'success'
return 'success'
