{
    "name"  : "检测设备是否可访问portal",
    "problems" : {
        "certification_mark_unopen" : {
            "desc"      : "【问题】商业营销认证未开启",
            "advice"    : "【建议】进入WEB页面的商业营销认证并使用微信认证快速配置重新配置" 
        },
		"connectedness" : {
            "desc"      : "【问题】如无法ping通则说明网络连通性存在问题",
            "advice"    : "【建议】检查网络连通性" 
        }
    }
}

---------------------------code-------------------------------
response = cli('show run | in app-auth ad-url')
response = response.split(/\r?\n/)
if response.length == 2 :
	add_problem("certification_mark_unopen")
	return 'warn'
end

i = 1
while i < response.length :
    res = response[i]
	res = res.trim()
	reg = /http/
	if reg.test(res) == true :
        res = res.split(/\//)
		cmd = 'ping ' + res[2]
		response = cli(cmd)
        reg = /\!+/
        if reg.test(response) == false :
            add_problem("connectedness")
	        return 'warn'
        end
    end
	i = i + 1
end

return 'success'