{
    "name"  : "地址库版本检查",
    "problems" : {
        "lib" : {
            "desc"      : "【问题】地址库版本过低可能导致用户无法获取地址。",
            "advice"    : "【建议】地址库的版本低，存在bug，当开启移动地址库时，会往快转下发一条全255走公网IP的路由，导致EG开启DHCP时用户无法获取地址，请升级地址库版本到2015.01.06.10及以上版本或者关闭移动线路地址库。"
        }
    }
}
---------------------------code-------------------------------
res = cli("show run | in route-auto-choose cmcc")
resArr = res.split(/\r?\n/)
if resArr.length == 2 :
    return "success"
end
res = cli("show dhcp state")
if res.indexOf("false") != -1 :
    return "success"
end

res = cli("show http-update info versio")
resArr = res.split(/\r?\n/)
routeDbString = resArr[3]
routeDbString = routeDbString.trim()
routeDbStringArr = routeDbString.split(/\s+/)
routeDb = routeDbStringArr[2]

routeDb = routeDb.trim()
routeDbArr = routeDb.split(".")

year = routeDbArr[0]
month = routeDbArr[1]
day = routeDbArr[2]
nimute = routeDbArr[3]
routeNum = year + month + day + nimute
routeNum = parse_int(routeNum)

if routeNum < 2015010610 :
    add_problem("lib")
    return "warn"
end
return "success"
