{
    "name"  : "转发性能检查",
    "problems" : {
        "transmission" : {
            "desc"      : "【问题】设备高峰期转发性能不足或受到了攻击",
            "advice"    : "【建议】设备接口出现no buffer说明设备曾出现丢包，可能被攻击或设备高峰期转发性能不足。请确认设备性能可以满足，清空接口计数clear counters gigabitEthernet 0/X，观察no buffer是否有增长若观察期间接口no buffer仍在增长，需要做好防攻击优化并联系400排查。"
        }
    }
}
---------------------------code-------------------------------
res = cli("show interfaces")
#res = res.replace(/\s+/g, "")
resArr = res.match(/bytes, (.+) no buffer/g)
bufferValueArr = [];
i = 0
if resArr == null :
    return "success"
end
while i < resArr.length :
    resArrTemp = resArr[i]
    signlaValueArr = resArrTemp.match(/bytes, (\d+) no buffer/)
    signlaValueTemp = signlaValueArr[1]
    bufferValueArr.push(signlaValueTemp)
    i = i + 1
end

if bufferValueArr == null :
    return "success"
end

j = 0
while j < bufferValueArr.length:
    value = bufferValueArr[j]
    if value > 200000:
        add_problem("transmission")
        return "warn"
    end
    j = j + 1
end
return "success"



