{
    "name"  : "接口no_buffer是否存在增长",
    "precondition" : [],
    "problems" : {
        "buffer" : {
            "desc"      : "【问题】接口 ${0} 当前的no buffer个数持续增加（5秒前：${1},后：${2}），当前网络可能存在异常或攻击",
            "advice"    : [
                "【建议】当前网络可能存在攻击，请联系售后人员，进行防攻击相关的配置"          
            ]
        }
    }
}
---------------------------code-------------------------------
isProblemFound = false


lansDetail = get_share_value('lansDetail')

sleep(5000)

foreach int in lansDetail:
    #print int
    cmd = "show interface " + int.intf + " | include no buffer"
    run_int_info = cli(cmd)
    #print run_int_info

    data = formatBusser(run_int_info)
    #print data
    buffer = data - int.noBuffer
    #print buffer
    if buffer >= 5000:
        isProblemFound = true
        str1 = now_lan_bussers[lan.intf]
        str2 = int.noBuffer
        add_problem("buffer",[intf,str1,str2])
    end
end



if isProblemFound == true :
    return 'warn'
else:
    return 'success'
end