Send netdisco-users mailing list submissions to
        netdisco-users@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/netdisco-users
or, via email, send a message with subject or body 'help' to
        netdisco-users-requ...@lists.sourceforge.net

You can reach the person managing the list at
        netdisco-users-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of netdisco-users digest..."
Today's Topics:

   1. Re: how to generate report that maps IP to MAC addr to
      switch/port? (Christian Ramseyer)
--- Begin Message ---

On 24.03.21 17:42, Christian Vo wrote:
> Is there a known query that would be needed to run a report that provides

> 
> List of nodes within a given subnet
> The MAC address of each node
> The switch & switchport  to which the node is connected?
> 
> 
> I know I can run Reports à IP Inventory for a given subnet and get the
> listing of nodes and their mac address. But it’s tedious to click
> through each MAC addr and find the switch/switchport details.
> 
>  
> 
> If anyone can point me to an easy way to grab these details in a single
> view/csv  I’d greatly appreciate it!
> 
> Assumption is some sql code would be need to query tables, but I don’t
> know where to begin and lacking on the time to figure it out =(
> 
> Hoping someone already had this need at some point and solved it?


Hi

Here's a very old example query - I haven't tried it and given the age I
assume it's from Netdisco 1.x but it looks like it should still work:

https://netdisco-users.narkive.com/hlj65yTQ/netdisco-db-query

select
ni.mac,
ni.ip,
o.company,
d.dns,
n.port,
n.time_last
from
node_ip ni
join node n using (mac)
join device_port dp on n.switch = dp.ip
join device d on dp.ip = d.ip
left join oui o on n.oui = o.oui
where
ni.active
and n.active
and n.port = dp.port
order by
1,2;

This is the current data from the last poll. For historical data it gets
a bit more complicated, since the "active" flags will no longer be set
and you'd need to look into node(_ip).time(_first|last).

As a big Netdisco 2.x killer feature there should be a client hostname
in node_ip.dns.

I'm pretty sure we had a newer version of this on the list once, but I
can't locate it right now. Or maybe it was on github... if you google a
bit for the table names etc. you might be able to find it.



Cheers
Christian


-- 
Christian Ramseyer, netnea ag
Network Management. Security. OpenSource.
Phone: +41 79 644 77 64




--- End Message ---
_______________________________________________
Netdisco mailing list - Digest Mode
netdisco-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/netdisco-users

Reply via email to