{
    "name"  : "EG2000X/XE内存剩余容量检查",
    "problems" : {
        "memory" : {
            "desc"      : "【问题】设备内存不足有导致ospf震荡断网的风险。",
            "advice"    : "【建议】建议使用静态路或联系400处理。"
        }
    }
}
---------------------------code-------------------------------
mode = get_device_model()
if mode.indexOf("eg2000xe") == -1 && mode.indexOf("eg2000x") == -1 && mode.indexOf("eg2000ue") == -1 :
    return "skip"
end
res = cli("show run | in router ospf")
resArr = res.split(/\r?\n/)
if resArr.length == 2 :
    return "success"
end
res = cli("show memory")
resArr = res.match(/free, (.+)% used/)
usedRate = resArr[1]
if usedRate > 92 :
    add_problem("memory")
    return "warn"
end

return "success"