{
    "name"  : "PC或设备IP是否被限制连接数",
    "problems" : {
        "manageDevFullConnect" : {
            "desc"      : "【问题】管理PC的IP被限制连接数",
            "advice"    : "【建议】先确认管理PC所属的用户组对象，然后在WEB系统连接数限制中调整相应的规则"
        },
        "devManageFullConnect" : {
            "desc"      : "【问题】设备的管理IP被限制会话数",
            "advice"    : "【建议】先确认管理PC所属的用户组对象，然后在WEB系统连接数限制中调整相应的规则"
        }
    }
}
---------------------------code-------------------------------
#流表容量是否达到上限
STARTNUM = 1

manage_dev_ip = precondition('manage_dev_ip')
cmd = "show flow-pre-mgr ip-info | in " + manage_dev_ip
response = cli(cmd)
print response
results = response.split(/\r?\n/ig)
exist = false
i = STARTNUM
while i < results.length :
    resultTemp = results[i]
    if resultTemp.search(manage_dev_ip) != -1 : 
        all_num = results[i]
        all_num = all_num.trim()
		print 'all_num:' + all_num
        all_num = all_num.split(/[\s]{1,}/g)
		print 'all_num split:' + all_num.length
        flow_cnt = all_num[1]
        flow_limit = all_num[2]
		print 'flow_limit:' + flow_limit + ' flow_cnt:' + flow_cnt;
        if((flow_limit - flow_cnt) < 10) :
            add_problem('manageDevFullConnect')
            return 'warn'
        end
        break
    end
    i = i + 1
end

dev_manage_ip = precondition('dev_manage_ip')
cmd = "show flow-pre-mgr ip-info | in " + dev_manage_ip
response = cli(cmd)
print response
results = response.split(/\r?\n/ig)
exist = false
i = STARTNUM
while i < results.length :
    resultTemp = results[i]
    if resultTemp.search(dev_manage_ip) != -1 : 
        all_num = results[i]
        all_num = all_num.trim()
		print 'all_num:' + all_num
        all_num = all_num.split(/[\s]{1,}/g)
		print 'all_num split:' + all_num.length
        flow_cnt = all_num[1]
        flow_limit = all_num[2]
		print 'flow_limit:' + flow_limit + ' flow_cnt:' + flow_cnt;
        if((flow_limit - flow_cnt) < 10) :
            add_problem('devManageFullConnect')
            return 'warn'
        end
        break
    end
    i = i + 1
end

return 'success'





