{
    "name"  : "接口速率检查",
    "problems" : {
        "interfaceFlow" : {
            "desc"      : "【问题】环境中存在百兆端口",
            "advice"    : "【建议】接口速率协商为100M，若实际带宽大于百兆，则影响线路带宽，需要排查是EG/NPE自身接口速率配置问题还是对端设备配置问题，如接口确实为100M线路忽略此条。"
        }
    }
}
---------------------------code-------------------------------
res = cli("show ip i b | in Ethernet")
resArr = res.split(/\r?\n/)
interfaceArr = []
i = 1
while i < (resArr.length - 1) :
    resSignal = resArr[i]
    if resSignal.indexOf("down") == -1 && resSignal.indexOf("DOWN") == -1 :
        resSignal = resSignal.trim()
        resSignalArr = resSignal.split(/\s+/)
        interfaceHead = resSignalArr[0]
        interfaceNumber = resSignalArr[1]
        interfaceName = interfaceHead + " " + interfaceNumber
        interfaceArr.push(interfaceName)
    end
    i = i + 1
end

print interfaceArr

j = 0
while j < interfaceArr.length :
    interfaceName = interfaceArr[j]
    cmd = "show interface " + interfaceName + " | in 100M"
    res = cli(cmd)
    print res
    resArr = res.split(/\r?\n/)
    if resArr.length > 2 :
        add_problem("interfaceFlow")
        return "warn"
    end
    j = j + 1
end

return "success"