{
    "name"  : "检测是否认证功能开启且未认证通过",
    "problems" : {
        "error" : {
            "desc"      : "【问题】开启了web认证或app认证功能，但是该IP未认证通过",
            "advice"    : "【建议】请关闭相应认证功能或该用户使用浏览器访问网页进行认证"
        }
    }
}

---------------------------code-------------------------------
ipCheck = precondition('ipCheck')
cmd = 'show app-auth statistics'
response = cli(cmd)
print response

if response.match(/Invalid input/ig)!= null:
    print 'enter skip'
    return 'skip'
end

response1 = response.split(/\r?\n/)
if response1.length < 3 :
	result1 = null
else:
	result1 = response1[2]
end
if result1.indexOf("off") != -1 :
	result1 = null
end 

response = cli('show web-auth global')
print response
result = response.split(/\r?\n/)
if result.length < 3 :
	result = null
else:
	result = result[1]
end

if result.indexOf("disable") != -1 :
	result = null
end
print result1
print result

if result1 == null && result == null : 
	return 'success'
end

if result1 != null:
    reg = /[\r\n]\s*(?:.+?\s{2,}){3}On/i
    cmd = 'show app-auth user by-ip ' + ipCheck
    response = cli(cmd)
    result = response.match(reg)
    if result == null :
        add_problem('error')
        return 'warn'
    end
end

if result != null:
    reg = /Status\:\s+?Active/i
    cmd = 'show web us ip ' + ipCheck
    response = cli(cmd)
    result = response.match(reg)
    if !result :
        add_problem('error')
        return 'warn'
    end
end

return 'success'