{
    "name"  : "核心交换机系统功率检测",
    "problems" : {
        "power_is_no_enough" : {
            "desc"      : "【问题】 查看日志提示当前系统功率不足。该问题会导致系统告警或部分线卡无法供电使用。若当前该问题已解决则无需关注该日志。",
            "advice"    : "【建议】 请检查当前设备供电是否正常，必要时请增加电源模块增加供电功率。"
        }
    }
}
---------------------------code-------------------------------
#step 1---------------------------
cli_result = cli('show version')
reg = /11./
if !reg.test(cli_result) :
    return 'skip'
end

#step 2--------------------------
cli_result = cli('show clock')
cli_result = cli_result.split(/\n+/)
cli_result = cli_result[1]
cli_result = cli_result.split(/\s?,\s?/)
current_date = cli_result[1]

#step 3---------------------------
cli_result = cli('show logging | include power')
reg = /power is not enough/
if reg.test(cli_result) :
    reg = /[a-zA-Z]{3}\s\d+/
	log_date = cli_result.match(reg)
	log_date = log_date[0]
    if log_date == current_date :
	    add_problem('power_is_no_enough')
		return 'warn'
	end
end

return 'success'