{
    "name"  : "tcp连接数检查",
    "problems" : {
        "tcpNumber" : {
            "desc"      : "【问题】tcp连接太多，可能存在tcp connnect泄露。",
            "advice"    : "【建议】建议排查设备是否受到攻击，或者是否有太多终端连接到设备上。"
        }
    }
}
---------------------------code-------------------------------
res = cli("show tcp connect")
resArr = res.split(/\r?\n/)
if (resArr.length - 3) > 500 :
    add_problem("tcpNumber")
    return "warn"
end
#if resArr.length > 3 :
    #lastIndex = resArr.length - 1
    #resLast = resArr[lastIndex]
    #resLast = resLast.trim()
    #resLastArr = resLast.split(/\s+/)
    #connectNumber = resLastArr[0]
    #if  connectNumber > 500 :
        #add_problem("tcpNumber")
        #return "warn"
    #end    
#end

return 'success'
