Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with disk upper than 2TB with SNMP

Status
Not open for further replies.

rodjeur

IS-IT--Management
May 16, 2008
2
0
0
FR
Hello,

I'm trying to submit SNMP requests to my NAS NetApp in order to retrieve the size of my different volumes.
But the values returned are negative when the volume is greater then 2TB:

snmpwalk -v 1 -c xxx 192.168.14.155 .1.3.6.1.4.1.789.1.5.4.1.15
SNMPv2-SMI::enterprises.789.1.5.4.1.15.1 = INTEGER: -390004580


I've seen that the MIB contains two interesting OIDs upon this subject but I'm unable to recover the good values:
- dfHighTotalKBytes (.1.3.6.1.4.1.789.1.5.4.1.14)
=> The total capacity in KBytes for the
referenced file system. This object returns
the most significant 32 bits of the 64 bit
unsigned integer.


- dfLowTotalKBytes (.1.3.6.1.4.1.789.1.5.4.1.15)
=> The total capacity in KBytes for the
referenced file system. This object returns
the least significant 32 bits of the 64 bit
unsigned integer.



Any idea ?

Thanks.
 
It's returning a 64 bit unsigned integer, but snmpwalk is displaying it as a signed integer.

 
Well xmsre, thanks for your response.
I've found a solution which was not evidently for me ! I give it if somebody else is confronted to the same problem one day:

- retrieve the two values in the OIDs "High" and "Low" corresponding to the data you want know the size,
- in a bash script, use this code:

Code:
((High &= 0x7FFFFFFF))
[ 0 -gt "${Low}" ] && ((Low += 0x100000000))
((value=(High << 32) + Low))

You'll have the good result in the variable "value"...
 


uint8 df_high = dfHighTotalKBytes;
uint8 df_low = dfLowTotalKBytes;
uint8 df = (df_high << 32) + df_low;

looks like the same solution.

xmsre

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top