{
    "name"  : "DHCP是否被ip session filter放通检查",
    "problems" : {
        "dhcp" : {
            "desc"      : "【问题】DHCP报文可能未被ip session filter放通。",
            "advice"    : "【建议】同时开启了ip session filter功能和DHCP功能需要在ip session filter调用的ACL中放通DHCP报文；permit udp any range 67 68 any range 67 68。"
        }
    }
}
---------------------------code-------------------------------
res = cli("show dhcp state")
if res.indexOf("false") != -1 :
    return "success"
end
res = cli("show run | in ip session filter")
resArr = res.split(/\r?\n/)
needGoon = false
if resArr.length <= 2 :
    return "success"
end
if resArr.length > 2 :
    resFilter = resArr[1]
    filterArr = resFilter.match(/ip session filter\s\d/)
    filternum = filterArr[0]
	filter=filternum.match(/\d/)
	filter0=filter[0]
    if filter0 == 0 :
        return "success"
    end
else :
    needGoon = true
end
if needGoon :
    res = cli("show run | in eq bootpc")
    res1 = cli("show run | in eq bootps")
    res2 = cli("show run | in range bootps bootpc")
    resArr = res.split(/\r?\n/)
    resArr1 = res1.split(/\r?\n/)
    resArr2 = res2.split(/\r?\n/)
    if resArr.length == 2 && resArr1.length == 2 && resArr2.length == 2 :
        add_problem("dhcp")
        return "warn"
    end
end
return "success"