{
    "name"  : "dns代理运营商属性",
    "precondition" : [],
    "problems" : {
        "dns" : {
            "desc"      : "【问题】接口 ${0}上的dns服务器地址${1} 配置错误，其属于${2}运营商,但是接口属于${3}运营商",
            "advice"    : [
                "【建议】请从该线路运营商获取有效的dns服务器地址，并替换掉",
                "可从web界面：网络配置->DNS配置->正向DNS代理->更改对应接口上的DNS服务器地址"             
            ]
        }
    }
}

---------------------------code-------------------------------

isProblemFound = false
wansDetail = get_share_value('wansDetail')
isMultiIsp = false

operators = {}
foreach wan in wansDetail:
    if !wan.isUP || wan.ip :
        continue
    end
    intf = wan.intf
    intfOperator = wan.operator
    dns = wan.dns
    foreach _dns in dns:
        dnsIp = _dns.dnsIp;
        dnsOperator = _dns.dnsOperator; 
        if dnsIp && dnsOperator != intfOperator :
            isProblemFound = true
            str1 = getOperatorText(dnsOperator)
            str2 = getOperatorText(intfOperator)
            add_problem("dns",[intf,dnsIp,])
        end
    end

end




if isProblemFound == true :
    return 'warn'
else:
    return 'success'
end
