No 64-bit traffic counters in SNMP



  • SNMP does not return any Counter64 values for any of my OpenVPN interfaces (client or server). The only interfaces with 64-bit counters are the two NICs and their VLANs.

    IF-MIB::ifName.1 = STRING: igb0
    IF-MIB::ifName.2 = STRING: igb1
    IF-MIB::ifName.3 = STRING: lo0
    IF-MIB::ifName.4 = STRING: enc0
    IF-MIB::ifName.5 = STRING: pflog0
    IF-MIB::ifName.6 = STRING: pfsync0
    IF-MIB::ifName.7 = STRING: igb1.666
    IF-MIB::ifName.8 = STRING: igb1.42
    IF-MIB::ifName.9 = STRING: ovpns3
    IF-MIB::ifName.10 = STRING: ovpnc5
    IF-MIB::ifName.11 = STRING: ovpnc6
    IF-MIB::ifName.12 = STRING: ovpnc1

    IF-MIB::ifOutBroadcastPkts.12 = Counter32: 0
    IF-MIB::ifHCInOctets.1 = Counter64: 151272924499
    IF-MIB::ifHCInOctets.2 = Counter64: 702458174954
    IF-MIB::ifHCInOctets.7 = Counter64: 306268390814
    IF-MIB::ifHCInOctets.8 = Counter64: 165550732282
    IF-MIB::ifHCInUcastPkts.1 = Counter64: 205023831
    ...

    I'm running 2.4.2-RELEASE-p1 (amd64).

    It doesn't look like an SNMP issue since none of the ovpnXX byte counters exceed 2^32 when I run 'netstat -ib'.

    It seems like it should be a tun driver issue but I looked at if_tun.c and it looks like it's doing the right thing.

    Any ideas?


  • Rebel Alliance Developer Netgate

    Are you using the built-in bsnmpd or the net-snmp package?

    net-snmp appears to have counter64 data for ovpn interfaces.

    $ snmpwalk bill ifName            
    IF-MIB::ifName.1 = STRING: vmx0
    IF-MIB::ifName.2 = STRING: vmx1
    IF-MIB::ifName.3 = STRING: vmx2
    IF-MIB::ifName.4 = STRING: lo0
    IF-MIB::ifName.5 = STRING: enc0
    IF-MIB::ifName.6 = STRING: pflog0
    IF-MIB::ifName.7 = STRING: pfsync0
    IF-MIB::ifName.8 = STRING: gif0
    IF-MIB::ifName.9 = STRING: ovpns2
    IF-MIB::ifName.10 = STRING: ovpns4
    IF-MIB::ifName.11 = STRING: ovpns1
    $ snmpwalk bill ifHCInOctets
    IF-MIB::ifHCInOctets.1 = Counter64: 206324779
    IF-MIB::ifHCInOctets.2 = Counter64: 1245848
    IF-MIB::ifHCInOctets.3 = Counter64: 0
    IF-MIB::ifHCInOctets.4 = Counter64: 3667209
    IF-MIB::ifHCInOctets.5 = Counter64: 0
    IF-MIB::ifHCInOctets.6 = Counter64: 0
    IF-MIB::ifHCInOctets.7 = Counter64: 0
    IF-MIB::ifHCInOctets.8 = Counter64: 8469397
    IF-MIB::ifHCInOctets.9 = Counter64: 8510755
    IF-MIB::ifHCInOctets.10 = Counter64: 0
    IF-MIB::ifHCInOctets.11 = Counter64: 0
    $ snmpwalk bill ifInOctets
    IF-MIB::ifInOctets.1 = Counter32: 206350521
    IF-MIB::ifInOctets.2 = Counter32: 1246200
    IF-MIB::ifInOctets.3 = Counter32: 0
    IF-MIB::ifInOctets.4 = Counter32: 3667209
    IF-MIB::ifInOctets.5 = Counter32: 0
    IF-MIB::ifInOctets.6 = Counter32: 0
    IF-MIB::ifInOctets.7 = Counter32: 0
    IF-MIB::ifInOctets.8 = Counter32: 8470213
    IF-MIB::ifInOctets.9 = Counter32: 8511571
    IF-MIB::ifInOctets.10 = Counter32: 0
    IF-MIB::ifInOctets.11 = Counter32: 0
    
    

    Index 9 is the one to look at.

    If you don't need anything from the pf MIB then you are probably better off using the NET-SNMP package.