Linux – SNMP bytes received disagrees with ifconfig

linuxnet-snmpsnmpsnmpd

SNMP ifInOctets = 2145342796 – about 2GB.

ifconfig: RX bytes:174302710687 (174.3 GB)


Interestingly, the sent bytes agree almost perfectly:

ifOutOctets: 1002415050 – about 1GB

ifconfig: TX bytes:1002418728 (1.0 GB)


It's not an SNMP discontinuity:

snmpwalk -v2c -c public localhost 1.3.6.1.2.1.31.1.1.1.19    
iso.3.6.1.2.1.31.1.1.1.19.1 = Timeticks: (0) 0:00:00.00
iso.3.6.1.2.1.31.1.1.1.19.2 = Timeticks: (0) 0:00:00.00
iso.3.6.1.2.1.31.1.1.1.19.3 = Timeticks: (0) 0:00:00.00

Anyone have an idea for this discontinuity in the sent data numbers? Thanks so much!

(net-snmp, Ubuntu Linux, 12.04 LTS)

Best Answer

As twalberg suggests, this is probably a 32-bit overflow problem.

SNMP Interface Counters in are 32-bit (unsigned) by default. If your SNMP daemon and server OS support 64-bit counters they can be found in the ifXtable MIB (.1.3.6.1.2.1.31.1.1)