Les statistiques des interfaces réseaux par SNMP (net-mgmt/net-snmp) ne sont pas directement fonctionnels sous FreeBSD 64 bits (aucun problème pour les OS 32 bits) :

# snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.2.1.31.1.1.1
IF-MIB::ifName.1 = STRING: re0
IF-MIB::ifName.2 = STRING: lo0

Seuls les noms d’interfaces sont renvoyés. Les compteurs systèmes étant codés sur 64 bits et n’étant pas supportés par défaut par SNMP, il faut recompiler le port avec l’option WITH_MFD_REWRITES pour y remédier:

# make deinstall && make clean
# make -DWITH_MFD_REWRITES
# make install
# /usr/local/etc/rc.d/snmpd restart

SNMP peut alors reporter l’ensemble des statistiques :

# snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.2.1.31.1.1.1
IF-MIB::ifName.1 = STRING: re0
IF-MIB::ifName.2 = STRING: lo0
IF-MIB::ifInMulticastPkts.1 = Counter32: 368234
IF-MIB::ifInMulticastPkts.2 = Counter32: 0
IF-MIB::ifInBroadcastPkts.1 = Counter32: 0
IF-MIB::ifInBroadcastPkts.2 = Counter32: 0
IF-MIB::ifOutMulticastPkts.1 = Counter32: 0
IF-MIB::ifOutMulticastPkts.2 = Counter32: 0
IF-MIB::ifOutBroadcastPkts.1 = Counter32: 0
IF-MIB::ifOutBroadcastPkts.2 = Counter32: 0
IF-MIB::ifHCInOctets.1 = Counter64: 86439204
IF-MIB::ifHCInOctets.2 = Counter64: 1355164
IF-MIB::ifHCInUcastPkts.1 = Counter64: 549735
IF-MIB::ifHCInUcastPkts.2 = Counter64: 11430
IF-MIB::ifHCInMulticastPkts.1 = Counter64: 368234
IF-MIB::ifHCInMulticastPkts.2 = Counter64: 0
IF-MIB::ifHCInBroadcastPkts.1 = Counter64: 0
IF-MIB::ifHCInBroadcastPkts.2 = Counter64: 0
IF-MIB::ifHCOutOctets.1 = Counter64: 41458007
IF-MIB::ifHCOutOctets.2 = Counter64: 1355164
IF-MIB::ifHCOutUcastPkts.1 = Counter64: 121314
IF-MIB::ifHCOutUcastPkts.2 = Counter64: 11430
IF-MIB::ifHCOutMulticastPkts.1 = Counter64: 0
IF-MIB::ifHCOutMulticastPkts.2 = Counter64: 0
IF-MIB::ifHCOutBroadcastPkts.1 = Counter64: 0
IF-MIB::ifHCOutBroadcastPkts.2 = Counter64: 0
IF-MIB::ifHighSpeed.1 = Gauge32: 1000
IF-MIB::ifHighSpeed.2 = Gauge32: 0
IF-MIB::ifPromiscuousMode.1 = INTEGER: false(2)
IF-MIB::ifPromiscuousMode.2 = INTEGER: false(2)
IF-MIB::ifConnectorPresent.1 = INTEGER: true(1)
IF-MIB::ifConnectorPresent.2 = INTEGER: true(1)
IF-MIB::ifAlias.1 = STRING:
IF-MIB::ifAlias.2 = STRING:
IF-MIB::ifCounterDiscontinuityTime.1 = Timeticks: (0) 0:00:00.00
IF-MIB::ifCounterDiscontinuityTime.2 = Timeticks: (0) 0:00:00.00

Le monitoring réseau par SNMP est alors possible.