{
    "name"  : "服务器数据流是否被防攻击ACL过滤",
    "problems" : {
        "port" : {
            "desc"      : "【问题】防攻击ACL未显示配置放通服务器映射后的公网IP地址。",
            "advice"    : "【建议】请检查ip session filter关联的ACL规则。"
        }
    }
}
---------------------------code-------------------------------
publicNetIp = precondition('publicNetIp')
res = cli("show run | in ip session filter")
resArr = res.split(/\r?\n/) 
res1 = resArr[resArr.length - 1]
if res1.indexOf("#") == -1 :
	if resArr.length < 2:
		return "success"
	else :
		res2 = resArr[1]
		num = res2.match(/\d+/)
		if num == 0 :
			return "success"
		end
	end	
else :
	if resArr.length < 3:
		return "success"
	else :
		res2 = resArr[1]
		num = res2.match(/[0-9]+/ig)
		if num == 0 :
			return "success"
		end
	end	
end
AlcNumber =  res.match(/[0-9]+/ig)
cmd = "show access-lists " + AlcNumber + " | in permit" 
resAmp = cli(cmd)
regx = 'host ' + publicNetIp 
print regx
print resAmp.match(regx)
if resAmp.match(regx) == null :
	add_problem("port")
    return "warn"
end

return "success"
