{
    "name"  : "聚合端口软件缺陷",
    "problems" : {
        "noConError" : {
            "desc"      : "【风险】当前软件版本08XS-ED线卡所有端口都加入聚合口重启设备会导致线卡反复重启或端口不UP。",
            "advice"    : "【建议】可将该线卡个别端口退出聚合组或升级最新软件版本，推荐工具一键升级功能。"
        }
    }
}
---------------------------code-------------------------------
res = cli("show version")
print res
dateTmp = res.match(/\d+-\d+-\d+/)
print dateTmp
time = dateTmp[0]
time = time.trim()
time = time.split("-")
year = time[0]
mouth = time[1]
day = time[2]
if year > 2015 || year < 2015 && mouth > 2 || year < 2015 && mouth < 2 && day > 3:
	return 'skip'
end

res = cli("show version slots")
res = res.split(/\r?\n/)
i = 0
slot = ""
Dev = 1
while i < res.length:
	resTmp = res[i]
	if resTmp.indexOf("08XS-ED") != -1:
		if resTmp.match(/^\sok\r?\n/) != -1:
			tmp = resTmp.trim()
			tmp = tmp.split(/\s+/)
			slot = tmp[1]
			Dev = tmp[0]
			break
		end
	end
	i = i + 1
end
if slot == "":
	return 'skip'
end

res = cli("show switch virtual config")
i = 1
port = []
while i < 9:
	port1 = slot + "/" + i
	port.push(port1)
	i = i + 1
end

if res.indexOf("switch convert mode virtual") != -1:
	port = []
	while i < 9:
		port1 = Dev + "/" + slot + "/" + i
		port.push(port1)
		i = i + 1
	end
end

res = cli("show aggregatePort summary")
i = 0
while i < port.length:
	p = port[i]
	if res.match(p) == null:
		return 'success'
	end
	i = i + 1
end

add_problem("noConError")
return 'warn'
