{
    "name"  : "dns代理负载算法",
    "precondition" : [],
    "problems" : {
        "dns" : {
            "desc"      : "【问题】请使用基于带宽的负载均衡算法，当前有可能会存在网银或者游戏掉线",
            "advice"    : [
                "【建议】可运行如下配置进行修复", 
                "配置示例：",
                "Ruijie#config",
                "Ruijie(config)#dns-proxy",
                "Ruijie(config)#load-balance bandwidth",
                "Ruijie(config)#end",
                "Ruijie#write"               
            ]
        }
    }
}

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

isProblemFound = false

res1 = cli("show run | include dns-proxy")
res2 = cli("show dns-proxy configure | include load-balance")
dnsProxyConfig = formatDnsProxyConfig(res1, res2)
set_share_value('dnsProxyConfig', dnsProxyConfig)

if dnsProxyConfig.stateEnable && !dnsProxyConfig.bandwidth :
    isProblemFound = true
    add_problem("dns")
end


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