On Thu, Mar 20, 2014 at 07:48:56AM -0700, nairb rotsak wrote:
> I just had a customer of mine (running Ubuntu 10.04.4 32-bit) complain they 
> were getting a very weird graph.. and that the disk was reporting 
> -7697523019776 bytes. I manually did an snmpwalk.. and it reports that?
hrStorageSize is a SNMP Integer with a maximum size of 2^31 or
2147483647

In theory, there is no way that SNMP can return a negative number,
the specification says it should be 0..214etc

SNMP library returns a negative number, so we probably have overflow
here. The SNMP version won't matter as it returns the same value. It's
not like Interfaces which use different OIDs to get 64 bit counters.

You've made it a little difficult because you've put the cooked values
rather than the raw ones. Also having the real size of the drive would
help. 

The real size in bytes is hrStorageSize * hrStorageAllocationUnits
I think you have 4096 for the block size.

So the real answer is:
(2^32 - (7697523019776 / 4096)) * 4096
9894663024640.00
or
(2^32 - (7697523019776 / 4096)) * 4096 / 1024^4
8.99

You got a 9TB drive there?
If so, then the fix is pretty simple, if the used blocks is negative, 
add 2^32 to it. Let me know and I'll create a patch.

Odd things will happen with drives over 2^32 blocks or for a 4096 block
size a drive bigger than 16TB. In that case there is NO simple answer 
as there is no sensible way for the SNMP Agent on the server to
communicate back its correct size.

The correct answer is for someone to create a new SNMP host standard.
It's horribly out of date for things like multiple CPUs etc.

 - Craig

-- 
Craig Small (@smallsees)   http://enc.com.au/       csmall at : enc.com.au
Debian GNU/Linux           http://www.debian.org/   csmall at : debian.org
GPG fingerprint:        5D2F B320 B825 D939 04D2  0519 3938 F96B DF50 FEA5

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
jffnms-users mailing list
jffnms-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jffnms-users

Reply via email to