{
    "name"  : "DNS ALG是否开启",
    "problems" : {
        "dnsDelegate" : {
            "desc"      : "【问题】DNS ALG开启",
            "advice"    : "【建议】如果内网用户需要使用域名访问内网私网地址的服务器，需要关闭DNS ALG功能，关闭方法如下：no ip nat translation dns。"
        }
    }
}
---------------------------code-------------------------------
res = cli("show run | in ip nat inside source static")
if res.indexOf('.') != -1:
	resArr = res.split(/\r?\n/) 
	i = 1
	IpPortArr = []
	IpArr = []
	while i < (resArr.length - 1):
		resArrTmp = resArr[i]
		resArrTmp = resArrTmp.trim()
		print resArrTmp.indexOf("GigabitEthernet")
		if resArrTmp.indexOf("GigabitEthernet") == -1 :
			resTmp = resArrTmp.match(/(\d+\.)+\d+/) 
			PortIP = resTmp[0]
			IpPortArr.push(PortIP)
		else if resArrTmp.indexOf("GigabitEthernet") != -1:
			resTmp = resArrTmp.match(/(\d+\.)+\d+/) 
			IP = resTmp[0]
			IpArr.push(IP)
		end	  
		i = i + 1
	end
end

j = 0
while j < (IpPortArr.length - 1) :
    if IpPortArr[j] != IpPortArr[j + 1] :
		res = cli("show run | in no ip nat translation dns")
		res = res.split(/\r?\n/) 
		if res.length == 2 :
			add_problem("dnsDelegate")
			return "warn"
		end
	end
	j = j + 1
end 

j = 0
print IpArr.length - 1
while j < (IpArr.length - 1) :
    if IpArr[j] != IpArr[j + 1] :
		res = cli("show run | in no ip nat translation dns")
		res = res.split(/\r?\n/) 
		if res.length == 2 :
			add_problem("dnsDelegate")
			return "warn"
		end
	end
	j = j + 1
end 

return "success"