{
    "name"  : "是否为端口总功率过载导致供电异常",
    "precondition" : ["name", "type"],
    "problems" : {
        "management" : {
            "desc"      : "【问题】出现Power management下电端口，则说明对应端口发生过功率管理下电",
            "advice"    : "【建议】show poe power确认POE电源总功率是否足够，若功率不足，建议少接一些PD或增加电源功率"
        }
    }
}

---------------------------code-------------------------------
type = precondition('type')
if type != 'copper':
    add_reason('非电口类型的端口不需要进行该项诊断')
    return 'skip'
end

res = cli('show logging')

if res.search(/power\smanagement/) != -1 :
    add_problem('management')
    return 'warn'
end

return 'success'
