dynamic size in neighbor map should use device_port_properties

This commit is contained in:
Oliver Gorwits
2018-03-10 11:38:41 +00:00
parent 9fa8372685
commit 147ef33d5e
3 changed files with 4 additions and 6 deletions

View File

@@ -11,12 +11,9 @@ __PACKAGE__->table('device_port_speed');
__PACKAGE__->result_source_instance->is_virtual(1);
__PACKAGE__->result_source_instance->view_definition(<<ENDSQL
SELECT ip,
sum(btrim(speed, ' MGTbps')::float *
(CASE btrim(speed, ' 0123456789.')
WHEN 'Gbps' THEN 1000
WHEN 'Tbps' THEN 1000000
ELSE 1 END)) AS total
sum( COALESCE(dpp.raw_speed,1) ) as total
FROM device_port
LEFT OUTER JOIN device_port_properties dpp USING (ip, port)
WHERE type = 'ethernetCsmacd'
AND speed LIKE '%bps'
GROUP BY ip