{
    "name"  : "检测AC和AP的版本是否一致",
    "problems" : {
        "versionError" : {
            "desc"      : "【问题】检测到ap ${0}版本和ac不一致，ac版本是${1}",
            "advice"    : "【建议】建议对ap进行升级"
        }
    }
}

---------------------------code-------------------------------
response = cli('show version')
reg = /System\ssoftware\sversion\s\:\sAC\_RGOS\s([^\,\r\n]+)/i
result = response.match(reg)
if !result :
    return 'skip'
end
acVersion = result[1]

response = cli('show version all real')
apVersionArr = formatApVersionInfo(response)
i = 0
length = apVersionArr.length
isVersionError = false
apError = ''
while i < length :
    data = apVersionArr[i]
	name = data.id
    version = data.version
	if version != acVersion :
        isVersionError = true
        if apError == '' :
            apError = apError + name
        else :
            apError = apError + '、' + name
        end
    end
    i = i + 1
end

if isVersionError == true :
    add_problem('versionError', [apError,acVersion])
    return 'warn'
end
return 'success'