Poor situation with snmp support in FreeBSD
Vasyl Samoilov
vas at mts.com.ua
Thu Mar 25 12:58:52 UTC 2010
Hello.
Lately I was desperatly trying to build a networking element based on
freebsd to fit into overall networking infrastructure. It's not a secret
that virtually anything now can do more or less snmp, thus I was trying
to monitor and query my boxes with snmp - it didn't end well. Any help
would be appreciated.
So far I found two options for snmp daemon - bsnmp and net-snmp.
net-snmo giving back invalid data, bsnmp lacks some data at all.
What do I expect to get from snmp? As for L3 device, I want to:
1) Get interfaces list with their properties (name, type, speed, mac,
subnets assigned)
2) Get ARP info (ipNetToPhysicalTable or ipNetToMedia)
3) Get routing table
4) Get neighboor data - LLDP is common protocol for devices now.
extra bonuses like mac address table or vlan info is out of the scope
for now.
setup:
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
ether 00:02:b3:c9:75:ef
inet 192.168.2.2 netmask 0xffffff00 broadcast 192.168.2.255
media: Ethernet autoselect (10baseT/UTP <full-duplex>)
status: active
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8<VLAN_MTU>
ether 00:02:b3:c9:75:df
inet 10.101.45.10 netmask 0xffffff80 broadcast 10.101.45.127
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
ether 00:07:e9:0b:2d:96
inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=3<RXCSUM,TXCSUM>
inet 127.0.0.1 netmask 0xff000000
tun5: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
inet 192.168.150.5 --> 192.168.150.6 netmask 0xffffffff
Opened by PID 1508
vboxnet0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 0a:00:27:00:00:00
(vboxnet0 was up during snmp session)
IF-MIB::ifName.1 = STRING: re0
IF-MIB::ifName.2 = STRING: rl0
IF-MIB::ifName.3 = STRING: em0
IF-MIB::ifName.4 = STRING: lo0
IF-MIB::ifName.5 = STRING: vboxnet0
IF-MIB::ifName.6 = STRING: tun5
Results:
* net-snmp got ipRoute table, which is outdated. The information is
relatively correct, but all the types considered to be "local". bsnmp,
on the other hand, got ipCidrRoute group, but it prints out only routes
ipCidrRouteType=remote, and ipCidrRouteProto=netmgmt, which makes it
unuseable (not all routes are printed, only few that are non-local
destination).
* net-snmp can give out ipNetToMedia to get arp table (yes, it's old and
should not be used in 2010), bnsmp got no means to get arp table at all.
* out of link-layer advertisements daemons, ladvd seems to be most
bsd-compatible-feature-rich, but there is no way to export any kind on
link-layer info via snmp under freebsd at all. neither net-snmp or bsnmp
support this.
In all other cases, bsnmp was found superior to net-snmp under freebsd:
net-snmp don't handle connector information properly:
net-snmp:
IF-MIB::ifConnectorPresent.1 = INTEGER: true(1)
IF-MIB::ifConnectorPresent.2 = INTEGER: true(1)
IF-MIB::ifConnectorPresent.3 = INTEGER: true(1)
IF-MIB::ifConnectorPresent.4 = INTEGER: true(1)
IF-MIB::ifConnectorPresent.5 = INTEGER: true(1)
IF-MIB::ifConnectorPresent.6 = INTEGER: true(1)
bnsmp:
IF-MIB::ifConnectorPresent.1 = INTEGER: true(1)
IF-MIB::ifConnectorPresent.2 = INTEGER: true(1)
IF-MIB::ifConnectorPresent.3 = INTEGER: true(1)
IF-MIB::ifConnectorPresent.4 = INTEGER: false(2)
IF-MIB::ifConnectorPresent.5 = INTEGER: true(1)
IF-MIB::ifConnectorPresent.6 = INTEGER: false(2)
net-snmp doesn't handle interface ifHighSpeed and ifSpeed properly (An
estimate of the interface's current bandwidth):
net-snmp:
IF-MIB::ifHighSpeed.1 = Gauge32: 1000
IF-MIB::ifHighSpeed.2 = Gauge32: 100
IF-MIB::ifHighSpeed.3 = Gauge32: 1000
IF-MIB::ifHighSpeed.4 = Gauge32: 0
IF-MIB::ifHighSpeed.5 = Gauge32: 0
IF-MIB::ifHighSpeed.6 = Gauge32: 0
IF-MIB::ifSpeed.1 = Gauge32: 1000000000
IF-MIB::ifSpeed.2 = Gauge32: 100000000
IF-MIB::ifSpeed.3 = Gauge32: 1000000000
IF-MIB::ifSpeed.4 = Gauge32: 0
IF-MIB::ifSpeed.5 = Gauge32: 0
IF-MIB::ifSpeed.6 = Gauge32: 0
bsnmp:
IF-MIB::ifHighSpeed.1 = Gauge32: 10
IF-MIB::ifHighSpeed.2 = Gauge32: 100
IF-MIB::ifHighSpeed.3 = Gauge32: 1000
IF-MIB::ifHighSpeed.4 = Gauge32: 0
IF-MIB::ifHighSpeed.5 = Gauge32: 0
IF-MIB::ifHighSpeed.6 = Gauge32: 0
IF-MIB::ifSpeed.1 = Gauge32: 10000000
IF-MIB::ifSpeed.2 = Gauge32: 100000000
IF-MIB::ifSpeed.3 = Gauge32: 1000000000
IF-MIB::ifSpeed.4 = Gauge32: 0
IF-MIB::ifSpeed.5 = Gauge32: 0
IF-MIB::ifSpeed.6 = Gauge32: 0
net-snmp shows incorrect interface mac (a:0:27:0:0:0 is correct):
net-snmp:
IF-MIB::ifPhysAddress.1 = STRING: 0:2:b3:c9:75:ef
IF-MIB::ifPhysAddress.2 = STRING: 0:2:b3:c9:75:df
IF-MIB::ifPhysAddress.3 = STRING: 0:7:e9:b:2d:96
IF-MIB::ifPhysAddress.4 = STRING:
IF-MIB::ifPhysAddress.5 = STRING: 0:0:27:0:0:0
IF-MIB::ifPhysAddress.6 = STRING:
bsnmp:
IF-MIB::ifPhysAddress.1 = STRING: 0:2:b3:c9:75:ef
IF-MIB::ifPhysAddress.2 = STRING: 0:2:b3:c9:75:df
IF-MIB::ifPhysAddress.3 = STRING: 0:7:e9:b:2d:96
IF-MIB::ifPhysAddress.4 = STRING:
IF-MIB::ifPhysAddress.5 = STRING: a:0:27:0:0:0
IF-MIB::ifPhysAddress.6 = STRING:
More information about the freebsd-net
mailing list