Bug 1257161

Summary: net-snmp reports wrong filesystem size
Product: Red Hat Enterprise Linux 6 Reporter: Rikard <rikard.oberg>
Component: net-snmpAssignee: Jan Safranek <jsafrane>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.7CC: rikard.oberg, scott.worthington
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-03 08:32:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
df output
none
snmpwalk from new net-snmp
none
snmpwalk from old net-snmp none

Description Rikard 2015-08-26 11:50:02 UTC
Description of problem:
After installing net-snmp-5.5-54.el6.x86_64 and net-snmp-libs-5.5-54.el6.x86_64 net-snmp reports 10TB ext4 filesystem as 2TB. downgrading to net-snmp-5.5-50.el6_6.1.x86_64 and net-snmp-libs-5.5-50.el6_6.1.x86_64 makes it report correct again. 

For some reason it did not work with net-snmp-5.5-54.el6.x86_64 and net-snmp-libs-5.5-54.el6.x86_64 either so the bug probably was introduced here. I cannot se the fault on filesystems   

Version-Release number of selected component (if applicable):
See above

How reproducible:
upgrade to net-snmp-5.5-54.el6.x86_64 and net-snmp-libs-5.5-54.el6.x86_64



Actual results:
10TB filesystem shows as 2TB filesystem

Expected results:
show as 10TB filesystem

Additional info:
I have not seen the error on servers with 6TB filesystems

Comment 1 Rikard 2015-08-26 11:54:55 UTC
It should have been the latest available version net-snmp-5.5-54.el6_7.1.x86_64 and net-snmp-libs-5.5-54.el6_7.1.x86_64 under "Description of problem" 

//Rikard

Comment 3 Jan Safranek 2015-08-27 16:04:50 UTC
This may be related to bug #1104293 (sorry, confidential) that we fixed in RHEL 6.7. Can you please post snmpwalk output with the bad numbers (=new net-snmp) and good numbers (=old net-snmp packages), together with `df` output?

Comment 4 Rikard 2015-08-31 09:07:16 UTC
Created attachment 1068549 [details]
df output

Comment 5 Rikard 2015-08-31 09:08:09 UTC
Created attachment 1068550 [details]
snmpwalk from new net-snmp

Comment 6 Rikard 2015-08-31 09:08:36 UTC
Created attachment 1068551 [details]
snmpwalk from old net-snmp

Comment 7 Jan Safranek 2015-08-31 14:09:50 UTC
The old net-snmp shows:
HOST-RESOURCES-MIB::hrStorageSize.37 = INTEGER: 2683487208

While the value is correct (2683487208 * hrStorageAllocationUnits gives size of the device), it's bad from SNMP protocol point of view. hrStorageSize must be  Integer32 (0..2147483647) and 2683487208 is higher than 2147483647. 

This caused several 3rd party clients to behave unexpectedly and therefore we fixed this bug in the latest Net-SNMP release - we report values lower than 2^31. To get real size of large drives, we introduced a new option 'realStorageUnits' couple of releases ago.

Add 'realStorageUnits 0' to your /etc/snmp/snmpd.conf. snmpd will then report artificial value of hrStorageAllocationUnits (probably 8k instead of 4k), so hrStorageAllocationUnits * hrStorageSize gives real size of the storage.

SNMP is really old protocol and they did not think about terabytes at that time...

Comment 8 Rikard 2015-09-03 07:25:57 UTC
(In reply to Jan Safranek from comment #7)
> The old net-snmp shows:
> HOST-RESOURCES-MIB::hrStorageSize.37 = INTEGER: 2683487208
> 
> While the value is correct (2683487208 * hrStorageAllocationUnits gives size
> of the device), it's bad from SNMP protocol point of view. hrStorageSize
> must be  Integer32 (0..2147483647) and 2683487208 is higher than 2147483647. 
> 
> This caused several 3rd party clients to behave unexpectedly and therefore
> we fixed this bug in the latest Net-SNMP release - we report values lower
> than 2^31. To get real size of large drives, we introduced a new option
> 'realStorageUnits' couple of releases ago.
> 
> Add 'realStorageUnits 0' to your /etc/snmp/snmpd.conf. snmpd will then
> report artificial value of hrStorageAllocationUnits (probably 8k instead of
> 4k), so hrStorageAllocationUnits * hrStorageSize gives real size of the
> storage.
> 
> SNMP is really old protocol and they did not think about terabytes at that
> time...

Thank you Jan now works to monitor the 10TB filesystems again. Using the new net-snmp-libs-5.5-54.el6_7.1.x86_64 and net-snmp-5.5-54.el6_7.1.x86_64 if the setting "realStorageUnits 0" is in /etc/snmp/snmpd.conf

Comment 9 Jan Safranek 2015-09-03 08:32:51 UTC
Thanks for the feedback. I am closing the bug now.

Comment 10 Jan Safranek 2015-09-21 13:02:18 UTC
*** Bug 1262944 has been marked as a duplicate of this bug. ***