|
From: John K. <kok...@ge...> - 2005-02-15 20:50:16
|
Robert
This is the output I received from the sql statement...
netdisco=> select d.ip,i.dns,d.port,count(distinct(n.mac)) from
netdisco-> device_port d,node n,device i where i.ip=d.ip and
d.ip=n.switch and
netdisco-> d.port=n.port and d.remote_ip is null and n.active=true group by
netdisco-> d.ip,d.port,i.dns having count(distinct(n.mac)) > 1 order by
netdisco-> count(distinct(n.mac)) desc;
ip | dns |
port | count
-----------------+------------------------------------------+---------------------+-------
141.161.xx.xx | NSO-BDF-C552 | 5.1 | 1400
141.161.xx.xx | dar-4th-c191 | 8 | 1371
141.161.185.186 | lvy-3rd-c41 | 252 | 375
141.161.xx.xx | dar-6th-c191 | 3 | 252
141.161.xx.xx | vlc-2y-c191 | 17 | 244
141.161.xx.xx | vlc-8y-c192 | A | 192
141.161.xx.xx| gulc-cat-6513 | 6.3 | 182
Robert Kerr wrote:
>On Tue, 2005-02-15 at 15:07, John Kokidko wrote:
>
>
>
>>Does anyone have a command that would identify ports that would have
>>multiple mac addresses.
>>
>>
>
>I assume you know you can do this from the web interface device search
>page? If you want to do it from the commadnline you can just execute the
>same sql as the device search page on the web interface does. It's a bit
>long winded, but fortunately the psql client keeps a history so you only
>have to get it right once:
>
>netdisco=> select d.ip,i.dns,d.port,count(distinct(n.mac)) from
>device_port d,node n,device i where i.ip=d.ip and d.ip=n.switch and
>d.port=n.port and d.remote_ip is null and n.active=true group by
>d.ip,d.port,i.dns having count(distinct(n.mac)) > 1 order by
>count(distinct(n.mac)) desc;
>
>Should give you such a list of ports with more than one MAC, ordered by
>the number of MACs present.
>
>
>
|