|
From: John K. <kok...@ge...> - 2005-02-15 19:59:18
|
Robert Thanks for the knowledge... I guess I just like working with command sql statements : ) Thanks John 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. > > > |