{
    "name"  : "DNS查询是否正常",
    "problems" : {
        "dnsNormal" : {
            "desc"      : "【问题】DNS查询存在无应答的情况",
            "advice"    : "【建议】请检查DNS服务器的可靠性"
        }
    }
}
---------------------------code-------------------------------
userNoNetIp = precondition('userNoNetIp')
cmd = "show ip f f | in " + userNoNetIp
response = cli(cmd)
results = response.split(/\r?\n/)

i = 1
print results.length
while i < (results.length - 1) :
    resultTmp = results[i]
    resultTmp = resultTmp.trim()
    arr = resultTmp.split(/\s+/)
    #获取目的端口(如果数据全存在取[6])
    #1,判断Nat转换后的公网源IP是否存在
    natSourchIP = arr[2]
    destinationPort = null
    receivedByte = null
    if natSourchIP.indexOf("(") != -1 && natSourchIP.indexOf(".") != -1:
        natDestinationIP = arr[4]
        if natDestinationIP.indexOf("(") != -1 && natDestinationIP.indexOf(".") != -1:
            #考虑端口也包含空格以及（）的情况
            destinationPort = arr[6]
            receivedByte = arr[9]
            if destinationPort.indexOf("(") != -1:
                destinationPort = arr[7]
                receivedByte = arr[10]
            end            
        else:
            destinationPort = arr[5]
            receivedByte = arr[8]
            if destinationPort.indexOf("(") != -1:
                destinationPort = arr[6]
                receivedByte = arr[9]
            end
        end
    else :
        natDestinationIP = arr[3]
        if natDestinationIP.indexOf("(") != -1 && natDestinationIP.indexOf(".") != -1:
            destinationPort = arr[5]
            receivedByte = arr[8]
            if destinationPort.indexOf("(") != -1:
                destinationPort = arr[6]
                receivedByte = arr[9]
            end
        else:
            destinationPort = arr[4]
            receivedByte = arr[7]
            if destinationPort.indexOf("(") != -1:
                destinationPort = arr[5]
                receivedByte = arr[8]
            end
        end        
    end
    print destinationPort
    print receivedByte
    if destinationPort == 53 && receivedByte == 0:
        add_problem("dnsNormal")
        return "warn"
    end
    i = i + 1
end

return "success"
