diff --git a/lib/App/Netdisco/DB/ResultSet/DevicePort.pm b/lib/App/Netdisco/DB/ResultSet/DevicePort.pm index 5f16c99d..636ef569 100644 --- a/lib/App/Netdisco/DB/ResultSet/DevicePort.pm +++ b/lib/App/Netdisco/DB/ResultSet/DevicePort.pm @@ -67,7 +67,7 @@ sub with_is_free { ->search({}, { '+columns' => { is_free => - \["me.up = ' up' AND me.up != 'up' AND me.type != 'propVirtual' AND " + \["me.up_admin = 'up' AND me.up != 'up' AND me.type != 'propVirtual' AND " ."((age(now(), to_timestamp(extract(epoch from device.last_discover) - (device.uptime/100))) < ?::interval " ."AND (last_node.time_last IS NULL OR age(now(), last_node.time_last) > ?::interval)) " ."OR age(now(), to_timestamp(extract(epoch from device.last_discover) - (device.uptime - me.lastchange)/100)) > ?::interval)",