Hello,

(Posted on both Net-SNMP's and nagios-snmp's mailing lists.)

 From a Linux server, I monitor disk usage on an AIX server, using a 
Nagios plugin called check_snmp_storage[1] which links to Net-SNMP 
libraries.

We recently overlooked a filesystem which had run full. When running 
snmpwalk against the AIX-server, I saw values along the lines of:

HOST-RESOURCES-MIB::hrStorageIndex.12 = INTEGER: 12
HOST-RESOURCES-MIB::hrStorageDescr.12 = STRING: /dev/fslv07
HOST-RESOURCES-MIB::hrStorageAllocationUnits.12 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageSize.12 = INTEGER: -1682702336
HOST-RESOURCES-MIB::hrStorageUsed.12 = INTEGER: -1956338944

A few weeks later (where storage capacity and usage had gone a bit 
further up), I sniffed on the network and saw the SNMP daemon returning 
2612264960 for HOST-RESOURCES-MIB::hrStorageUsed.12. The MIB for 
HOST-RESOURCES states that the value should be Integer32, i.e. a signed 
integer. So the MIB doesn't allow for values larger than 2147483647. A 
comparison:
  - Maximum, according to MIB: 2147483647
  - Sent on the network:       2612264960

Clearly, this is a case of an integer overflow: The Net-SNMP library is 
being strict in interpreting the Integer32 values, so the end value 
overflows (although one might argue that negative values for storage 
don't make sense and an ugly hack could be to allow for interpretation 
of Integer32 as a signed integer in some cases).

I guess I may be able to hack check_snmp_storage into somehow handling 
the situation differently, in case of negative numbers.

But what would the sensible way forward be? I'm thinking that the 
HOST-RESOURCES MIB is clearly outdated in specifying a signed 32-bit 
integer for block counts, but I have a hard time seeing how that could 
be changed.

Any thoughts/hints/comments?
Thanks in advance.


Links:
1. http://nagios.manubulon.com/package_c.html

-- 
Regards,
Troels Arvin <[email protected]>
http://troels.arvin.dk/

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to