Send netdisco-users mailing list submissions to
[email protected]
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
[email protected]
You can reach the person managing the list at
[email protected]
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 set up a SQL query to filter on all physical
Ethernet switch ports? (Nick Nauwelaerts)
--- Begin Message ---
that's a hard one, since regretfully not everyone follows the standards.
i would go at it partually manually, first getting a listing of all discovered
types in the current db. this is an example of our test setup:
testdisc@linux002:~> netdisco-do psql -e "select type, count(*) from
device_port group by type"
[24838] 2020-11-14 16:54:07 info App::Netdisco version 2.046006 loaded.
[24838] 2020-11-14 16:54:07 info psql: started at Sat Nov 14 17:54:07 2020
type | count
------------------------+-------
vmwareVirtualNic | 2
tunnel | 18
l2vlan | 46
adsl | 2
softwareLoopback | 15
atm | 1
propVirtual | 148
ethernetCsmacd | 1443
l3ipvlan | 5
propPointToPointSerial | 4
atmSubInterface | 1
gigabitEthernet | 102
propMultiplexor | 4
vdsl2 | 1
other | 26
aal5 | 2
ieee8023adLag | 79
(17 rows)
as you can see other asethernetCsmacd we also have gigabitEthernet, which most
likely is vendor specific. in our prod setup this list goes up to 22 different
kinds, but based on that it should still be possible to first make a manual
list of options based on type count & then use your query. in my example:
testdisc@linux002:~> netdisco-do psql -e "select speed, count(*) from
device_port where type like 'ethernetCsmacd' or type like 'gigabitEthernet'
group by speed"
[25019] 2020-11-14 17:03:11 info App::Netdisco version 2.046006 loaded.
[25019] 2020-11-14 17:03:11 info psql: started at Sat Nov 14 18:03:11 2020
speed | count
----------+-------
100 Mbps | 108
20 Gbps | 9
10 Gbps | 324
0 Mbps | 19
40 Gbps | 82
1.0 Gbps | 471
100 Gbps | 12
10 Mbps | 179
0 | 341
(9 rows)
(speed 0 went up in the count).
on the other hand some devices play loosely with what's considered
"ethernetCsmacd" or can even use it for internal devices (like the nexus
9332pq), so don't take this as the be all, end all. know what devices you have
& how they report their ports. netscalers reports their lo interfaces as class
ethernet, fortinet their inter npu links & modems.
i guess it boils down to knowing the class of devices you use and how their
snmp::info class reports their interfaces. any additional checks like valid
mac, mtu, vlan, etc... will removed both false positives as actual positives.
for your specific setup i doubt for example that the 2 & 16mbps hits are actual
ethernet devices (unless token ring counts as ethernet).
bottom line, i don't have a 1 size fits all example, but i guess this query
could help you on our way:
SELECT snmp_class,port,type,speed,dp.name,dp.mac,dp.mtu FROM public.device_port
dp
LEFT OUTER JOIN public.device d
ON dp.ip = d.ip
WHERE type = 'ethernetCsmacd'
ORDER BY speed ASC, mtu ASC, dp.mac ASC
// nick
From: Gerlach Tobias DLN FIII31 [mailto:[email protected]]
Sent: Thursday, November 12, 2020 16:12
To: [email protected]
Subject: [Netdisco] How to set up a SQL query to filter on all physical
Ethernet switch ports?
Hello all,
My current challenge is to report all physical Ethernet switch ports.
So far I used the ifType "ethernetCsmacd" from the interfaces MIB (IF-MIB,
http://www.net-snmp.org/docs/mibs/interfaces.html) as Ethernet is the only
relevant protocol.
However, the result looks a bit odd and there's a lot of other interface types
(ifType, http://www.net-snmp.org/docs/mibs/interfaces.html#IANAifType) and it's
probably up to the vendors to correctly populate this table.
Any ideas on how to achieve this demand most accurately?
$ netdisco-do psql -e "select speed, count(*) from device_port where type like
'ethernetCsmacd' group by speed"
[35929] 2020-11-12 14:31:01 info App::Netdisco version 2.046002 loaded.
[35929] 2020-11-12 14:31:01 info psql: started at Thu Nov 12 15:31:01 2020
speed | count
------------+--------
0 | 53782
1 | 717
100 | 25
1000 | 77
10000 | 113
1000000 | 1
100 Gbps | 456
100 Mbps | 80311
1.0 Gbps | 166875
10 Gbps | 30701
10 Mbps | 107699
1113 Tbps | 356
1410065408 | 11
15000000 | 5
16 Mbps | 1
200 Mbps | 2
20480000 | 1
2.0 Mbps | 5
20 Mbps | 12
23000 | 146
25000000 | 3
2500000000 | 9
25 Gbps | 1279
3000000 | 2
30000000 | 3
3209 Tbps | 82
40000000 | 1
400 Mbps | 2
40 Gbps | 2169
4.0 Mbps | 18
4294967295 | 83
4294 Tbps | 28
5000000 | 12
50000000 | 11
500000000 | 1
5.0 Gbps | 85
54 Mbps | 1
56418000 | 3
6000000 | 12
65 Gbps | 3
8000000 | 8
94030000 | 1
| 3455
(43 rows)
________________________________
Volg Aquafin op Facebook<https://www.facebook.com/AquafinNV> |
Twitter<https://twitter.com/aquafinnv> |
YouTube<http://www.youtube.com/channel/UCk_4P5BJ-MtEEDCkCsR_KqQ?feature=mhee> |
LinkedIN<http://www.linkedin.com/company/aquafin/products> |
Instagram<https://www.instagram.com/aquafin_nv/>
In het kader van de uitoefening van onze taken verzamelen we bij Aquafin
persoonsgegevens. Hoe we omgaan met deze gegevens en wat de rechten van de
betrokkenen zijn, kan je nalezen in onze privacy
policy<https://www.aquafin.be/nl-be/privacy-policy>.
P Denk aan het milieu. Druk deze mail niet onnodig af.
[www.aquafin.be] <https://blauwgroenvlaanderen.be/>
--- End Message ---
_______________________________________________
Netdisco mailing list - Digest Mode
[email protected]
https://lists.sourceforge.net/lists/listinfo/netdisco-users