{
    "name"  : "运营商是否限制ADSL线路MTU",
    "problems" : {
        "adsl_mtu" : {
            "desc"      : "【问题】运营商限制${0}的MTU，可能导致设备与认证服务器通信异常",
            "advice"    : "【建议】如果存在无法弹出认证界面的问题，可以尝试改小ADSL线路的MTU，修改方法为：进入dialer口配置模式，执行mtu 1400（或更小的值）" 
        }
    }
}

---------------------------code-------------------------------
#array_adsl和array_mtu一一对应(分别表示：up的dialer口及其对应的mtu值)
adsl = ""
array_adsl = []
array_mtu = []

res = cli("show ip i b | in dialer")
print res

res = res.split(/\r?\n/)
if res.length == 2 :
	return 'success'
end

i = 1
while i < (res.length - 1) :
	res_tmp = res[i]
	
	if res_tmp.search(/down/i) != -1 :
	else :
		res_tmp = res_tmp.match(/(dialer\s\d)\s+/i)
		res_tmp = res_tmp[1]
		array_adsl.push(res_tmp)
	end
	
    i = i + 1
end

if array_adsl.length == 0 :
	return 'success'
end

i = 0
while i < array_adsl.length :
	array_adsl_tmp = array_adsl[i]

	cmd = format("show interface %s | in MTU", array_adsl_tmp)
	res = cli(cmd)
	print res

	res = res.match(/MTU\s(\d+)\s/i)
	res = res[1]
	array_mtu.push(res)
	
	i = i + 1
end

i = 0
while i < array_adsl.length :
	array_adsl_tmp = array_adsl[i]
	array_mtu_tmp = array_mtu[i] - 28
	
	cmd = format("ping 114.114.114.114 source %s length %s df", array_adsl_tmp, array_mtu_tmp)
	res = cli(cmd)
	
	if res.match(/Success/i) != -1 :
		adsl = adsl + array_adsl_tmp + '、'
	end
	
	i = i + 1
end

if adsl == "" :
	return 'success'
else :
	adsl_tmp = adsl.lastIndexOf('、')
	adsl_tmp = adsl.substring(0, adsl_tmp)
	adsl = adsl_tmp
	add_problem('adsl_mtu', [adsl])
    return 'warn'
end