{
    "name"  : "正在检测商业营销配置是否正确",
    "problems" : {
        "certification_mark_unopen" : {
            "desc"      : "【问题】未开启商业营销认证",
            "advice"    : "【建议】可以在WEB上按照商业营销认证快速配置向导配置" 
        },
		"conflict" : {
            "desc"      : "【问题】商业营销认证和WEB认证不能同时开启",
            "advice"    : "【建议】商业营销认证场景请关闭WEB认证，命令为no web-auth enable" 
        },
		"unconf_white_list" : {
            "desc"      : "【问题】没有将认证服务器配置为白名单",
            "advice"    : "【建议】可以在WEB系统商业营销认证页面的免认证设置中配置" 
        },
		"flow_check_closed" : {
            "desc"      : "【问题】流量检测被关闭，可导致用户无法认证",
            "advice"    : "【建议】通过在WEB商业营销认证页面中开启流量检测下线" 
        }
    }
}

---------------------------code-------------------------------
response = cli('show run | in app-auth enable')
response = response.split(/\r?\n/)
if response.length == 2 :
	add_problem("certification_mark_unopen")
	return 'warn'
end

response = cli('show run | in web-auth enable')
response = response.split(/\r?\n/)
if response.length != 2 :
	add_problem("conflict")
	return 'warn'
end

response1 = cli('show run | in app-auth direct-dstip')
response1 = response1.split(/\r?\n/)
response2 = cli('show run | in app-auth direct-url')
response2 = response2.split(/\r?\n/)
if response1.length == 2 && response2.length == 2 :
	add_problem("unconf_white_list")
	return 'warn'
end

response = cli('show app-auth statistics')
reg = /flow_detect status\:\s*off/
if reg.test(response) == true :
    add_problem("flow_check_closed")
	return 'warn'
end

return 'success'
