{
    "name"  : "是否为单端口功率过载导致供电异常",
    "precondition" : ["name", "type"],
    "problems" : {
        "overload" : {
            "desc"      : "【问题】出现power overload下电端口，则说明对应端口发生过功率过载",
            "advice"    : "【建议】确认对应端口所接PD的额定功率及供电网线长度。更换非标PD或采用供电能力较强的POE设备对它供电"
        }
    }
}

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

res = cli('show logging')

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

return 'success'
