{
    "name"  : "请您确认：万兆光口是否曾使用过千兆光模块",
    "precondition" : ["name", "type", "deviceDesc"],
    "problems" : {
        "manual" : {
            "desc"      : "【原理说明】当前版本存在已知故障，当万兆端口曾使用过千兆光模块，随后更换使用万兆光模块会导致端口DOWN",
            "advice"    : ""
        }
    }
}
---------------------------code-------------------------------
deviceDesc = precondition('deviceDesc')
#deviceDesc = '11xSwitchBigBox'
name = precondition('name')
is11X = deviceDesc.indexOf('11x')
isBigBox = deviceDesc.indexOf('BigBox')
if is11X == -1 || isBigBox == -1 :
    add_reason('非11.X箱式交换设备不需要进行该项诊断')
    return 'skip'
end

cmd = 'show interface ' + name + ' status'
response = cli(cmd)
#reg = /------[\r\n]+.+?\s{2,}(\w+)\s{2,}(\w+)\s*[\r\n]/
reg = /TenGigabitEthernet/i 
result = response.match(reg)
if !result :
    add_reason('非万兆光口不需要进行该项诊断')
    return 'skip'
end
#bandWidth = result[1]
#type = result[2]
#if bandWidth != '10000M' || type != 'fiber' :
#    add_reason('非万兆光口不需要进行该项诊断')
#    return 'skip'
#end

response = cli('show version detail')
reg = /System\ssoftware\snumber\s+?\:\s.+?(\d{8})[\r\n]/
result = response.match(reg)
if !result :
    return 'skip'
end
versionDate = result[1]
reg = /(\d{2})(\d{2})(\d{4})/
result = versionDate.match(reg)
if !result :
    return 'skip'
end
month = result[1]
day = result[2]
year = result[3]
versionDate = year + '' + month + '' + day
versionDate = parse_int(versionDate)
#print versionDate

if versionDate < 20151008 :
    checkItems = ['{"checkItem": "是", "advice": "【解决方法】升级最新推荐软件版本可解决该问题</br><span style=margin-left:11px>【规避方案】重启设备线卡可暂时恢复端口状态</span>"}','{"checkItem": "否"}']
    add_problem("manual", [], [], [], checkItems)
    return 'warn'
end