{
    "name"  : "检测设备流表容量是否不足",
    "problems" : {
        "flowTableLack" : {
            "desc"      : "【问题】设备流表容量已达到上限",
            "advice"    : "【建议】请确认内网是否存在攻击或联系400客服进行深入人工诊断"
        }
    }
}

---------------------------code-------------------------------
response = cli('show ip f s')
reg = /The\scapacity\sof\sthe\sflow\stable\:([\d]+)/i
result = response.match(reg)
if !result :
    return 'skip'
end
totalFlowNum = result[1]

reg = /(?:Number\sof\sactive\sflows|Active\sflows\snum):([\d]+)/i
result = response.match(reg)
if !result :
    return 'skip'
end
activeFlowNum = result[1]

#print totalFlowNum
#print activeFlowNum
useageRatio = activeFlowNum / totalFlowNum
#print useageRatio

if useageRatio > 0.9 :
    add_problem('flowTableLack')
    return 'warn'
end 

return 'success'