{
    "name"  : "p3及之前版本存在端口缺陷",
    "problems" : {
        "copper" : {
            "desc"      : "【问题】当前版本首次使用万兆光口会导致端口可UP但无法进行业务通信。",
            "advice"    : "【建议】可整机重启或reset万兆光口所在线卡规避，可升级最新版本RGOS 10.4 (3b17)p5" 
        }
    }
}

---------------------------code-------------------------------
res = cli("show version")
res = res.split(/\r?\n/ig)
i = 0
while i < (res.length - 1):
	resTmp = res[i]
	if resTmp.indexOf("System software version") != -1:
		tmp = resTmp.match(/Release\(\d+\)/)
		tmp = tmp[0]
		tmp = tmp.match(/\d+/)
		tmp = tmp[0]
		print tmp
		if resTmp.indexOf("10.") == -1 || tmp > 176025:
			return 'success'
		end
		break
	end
	i = i + 1 
end

res = cli("show version slots")
res = res.split(/\r?\n/ig)
i = 2
while i < (res.length - 1):
 resTmp = res[i]
 if resTmp.indexOf("M86") != -1 && resTmp.indexOf("-EC") != -1 || resTmp.indexOf("12K") != -1 && resTmp.indexOf("-EA") != -1:
	res = cli("show log | include loop")
	if res.indexOf("detected loop, please check the network") != -1:
		add_problem("copper")
		return 'warn'
	end
 end
 i = i + 1
end

return 'success'