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

---------------------------code-------------------------------
physical = precondition('physicalPort')
physical = physical.portName

cmd = 'show interface ' + physical + ' | inc administratively down'
response = cli(cmd)
response = response.split(/\r?\n/)
val = response[2]
if val != null :
    add_problem("shutdown")
    return 'warn'
end

cmd = 'show interface ' + physical + ' | inc line protocol is DOWN'
response = cli(cmd)
response = response.split(/\r?\n/)
val = response[2]
if val != null :
    add_problem("copper")
    return 'warn'
end

return 'success'