{
    "name"  : "EG2000K/L子接口配置检查",
    "problems" : {
        "subInterface" : {
            "desc"      : "【问题】子接口未配置允许Vlan tag通过，会导致用户无法获取地址，手动配置地址也不能上网。",
            "advice"    : "【建议】WEB界面配置子接口会默认下发vlan port 0 4 tag，正常情况在命令配置会提“Notice: please use command 'vlan port' to add vlan entry.”要求配置vlan port 0 4。"
        }
    }
}
---------------------------code-------------------------------
mode = get_device_model()
if mode.indexOf("EG2000K") == -1 || mode.indexOf("EG1000L") == -1 :
    return "skip"
end
res = cli("show run | in interface")
res = res.split(/\r?\n/)
interfaceArr = []
i = 0
while i < res.length :
    resTemp = res[i]
    startIndex = resTemp.indexOf("interface")
    includePonit = resTemp.indexOf(".")
    if startIndex == 0 && includePonit == -1 :
        interface = resTemp.replace("interface ", "")
        interfaceArr.push(interface)
    end
    i = i + 1
end

j = 0
while j < interfaceArr.length:
    cmd = "show run interface " + interfaceArr[j] + " | in vlan port"
    res = cli(cmd)
    res = res.split(/\r?\n/)
    if res.length == 2 :
        add_problem(subInterface)
        return "warn"
    end
    j = j + 1
end 

return 'success'
 

