{
    "name"  : "FPGA缺陷问题检测",
    "problems" : {
        "noResponse" : {
            "desc"      : "【风险】现有引擎FPGA版本存在风险，该问题会导致设备异常重启",
            "advice"    : "【建议】请联系锐捷远程支持工程师安排FPGA版本升级，拨打电话4008-111-000" 
        }
    }
}

---------------------------code------------------------------- 
res = cli("show version")
if res.indexOf("N18010") == -1 && res.indexOf("N18014") == -1 && res.indexOf("S8610E") == -1 && res.indexOf("S8607E") == -1 && res.indexOf("S8605") == -1 && res.indexOf("S7805E") == -1:
	return 'success'
end

res = cli("show cpld version")
resTmp = res.split(/\r?\n/ig)
print resTmp
i = 0
while i < (resTmp.length - 1):
	tmp = resTmp[i]
	if tmp.match(/\d+/) != null: 
		tmp = tmp.trim()
		tmpArr = tmp.split(/\s+/)
		tmp = tmpArr[2]
		if tmp != null:
			print tmp
			if tmp < "14112101":
				add_problem('noResponse')
				return 'warn'
			end
		end
	end
	i = i + 1
end
return 'success'