{
    "name"  : "服务器数据流是否被接口ACL过滤",
    "problems" : {
        "port" : {
            "desc"      : "【问题】服务器数据流被ACL X（X为ACL规则号）阻断。",
            "advice"    : "【建议】请修改ACL规则放行服务器IP地址。"
        }
    }
}
---------------------------code-------------------------------
intraNetIp = precondition('intraNetIp')
res = cli("show ip i b | in up")
resArr = res.split(/\r?\n/) 
portArr = []
i = 1
while i < (resArr.length - 1):
    resArrTmp = resArr[i]
    resArrTmp = resArrTmp.trim()
    ressignalArr =  resArrTmp.split(/\s\s\s*/)
    portName = ressignalArr[0]
    portArr.push(portName)
    i = i + 1
end

j = 0
i = 1
ruleNumber = []
while j < portArr.length:
    portName = portArr[j]
    cmd = "show run interface " + portName + " | in ip access-group" 
    res = cli(cmd)
    resArr = res.split(/\r?\n/)
    if resArr.length > 2 :
		while i < (resArr.length - 1):
			resArrTmp = resArr[i]
			resArrTmp = resArrTmp.trim()
			ressignalArr =  resArrTmp.match(/[0-9]+/)
			ruleName = ressignalArr[0]
			ruleName = ruleName.trim()
			ruleNumber.push(ruleName)
			i = i + 1
		end 
    end
    j = j + 1
end

j = 0
while j < ruleNumber.length :
    portName = ruleNumber[j]
    cmd = "show access-lists " + portName + " | in deny" 
    res = cli(cmd)
	regx = 'host ' + intraNetIp
	if res.match(regx) != null :
		add_problem("port")
        return "warn"
    end
	j = j + 1
end

return "success"