Looking at the source of net-snmp-5.4.3~dfsg, it appears to make no
attempt to scale the block size to avoid 2^32 wrapping - see
agent/mibgroup/host/hr_storage.c, var_hrstore()

I have made a simple patch which fixes just this particular problem, so
should be suitable for backporting to LTS.

Once this patch has been applied, sane values are returned:

$ snmpwalk -v2c -c public storage3 hrStorageTable | grep '\.34 
'HOST-RESOURCES-MIB::hrStorageIndex.34 = INTEGER: 34
HOST-RESOURCES-MIB::hrStorageType.34 = OID: 
HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageDescr.34 = STRING: /disk/scratch
HOST-RESOURCES-MIB::hrStorageAllocationUnits.34 = INTEGER: 65536 Bytes
HOST-RESOURCES-MIB::hrStorageSize.34 = INTEGER: 1098363146
HOST-RESOURCES-MIB::hrStorageUsed.34 = INTEGER: 1052804334

(Note: the agent modules are actually in libsnmp15, so after dpkg-
buildpackage remember to install libsnmp15, libsnmp-base and snmpd)

** Patch added: "hrStorage_large_filesystem.patch"
   
https://bugs.launchpad.net/ubuntu/+source/net-snmp/+bug/865268/+attachment/3412218/+files/hrStorage_large_filesystem.patch

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to net-snmp in Ubuntu.
https://bugs.launchpad.net/bugs/865268

Title:
  snmpd reports wrong value for hrStorageSize on large filesystem

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/net-snmp/+bug/865268/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to