FreeBSD : statistiques réseaux par SNMP

Boris HUISGEN March 19, 2009

administration bsd freebsd snmp

Les statistiques SNMP des interfaces réseaux (net-mgmt/net-snmp) ne sont pas directement fonctionnels sous FreeBSD 64 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 reporte alors l’ensemble des statistiques :

    # snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.2.1.31.1.1.1</code>
    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

See also

Packet Filter : protection bruteforce SSH
Read more
Nginx : FastCGI CGI/Perl par socket UNIX
Read more
Nginx : FastCGI PHP par socket UNIX
Read more