{
    "name"  : "检测物理口是否插线或被shutdown",
    "problems" : {
        "copper" : {
            "desc"      : "【问题】物理口未插线",
            "advice"    : "【建议】请检查线路" 
        },
        "shutdown" : {
            "desc"      : "【问题】物理口被shutdown",
            "advice"    : "【建议】请在对应的物理口上执行no shutdown" 
        }
    }
}

---------------------------code-------------------------------
physical = precondition('physicalPort')
physical = physical.portName
cmd = 'show ip interface brief | inc ' + physical
response = cli(cmd)

reg = /\s+administratively\sdown\s+\w+\s*[\r\n]/i
if reg.test(response) == true:
    add_problem('shutdown')
    return 'warn'
end

reg = /\s+down\s+\w+\s*[\r\n]/i
if reg.test(response) == true:
    add_problem('copper')
    return 'warn'
end

return 'success'