Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SNMP is reporting total disk space as 1TB instead of 2TB

Posted on 2013-05-27
2
Medium Priority
?
2,098 Views
Last Modified: 2013-11-22
I'm running a FreeNAS server which is on FreeBSD, running the "bsnmpd" daemon for SNMP.

The server is being monitored by a "Centreon Enterprise Server" (CES) server, which checks disk space via SNMP using the "check_centreon_snmp_remote_storage" script.

The problem is the check is coming back showing the "total size" of the disk to be 1024GB, even though the disks are larger than that.

I've confirmed that the Centreon script is working properly. It's the SNMP daemon that is incorrectly reporting the total size of the disk.

Here's an example of the results I see if I use SNMPWALK to examine one of FreeNAS's disks which I know is 3TB in size:

HOST-RESOURCES-MIB::hrStorageDescr.12 = STRING: /mnt/BIGDISK, type: zfs, dev: BIGDISK
HOST-RESOURCES-MIB::hrStorageSize.12 = INTEGER: 2147483647
HOST-RESOURCES-MIB::hrStorageAllocationUnits.12 = INTEGER: 512 Bytes
HOST-RESOURCES-MIB::hrStorageUsed.12 = INTEGER: 1730777472

Doing the math with the AllocationUnits, this translates into 1024GB total size, and 825.3GB used. But that's not correct. My disks are 3TB in size.

This is happening for ALL disks on two different FreeNAS servers which exceed 1TB. Any disks which are LESS than 1TB get reported correctly. Sounds like an integer overflow issue since the number is precisely 2147483647.

I guess this is a problem with bsnmpd, or the libraries inside which are calculating the size of the disk, but is there a way I can go about trying to fix it?
0
Comment
Question by:Frosty555
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 25

Accepted Solution

by:
Cyclops3590 earned 2000 total points
ID: 39200905
You are correct.  This is why SNMP is getting worse and worse all the time for monitoring todays systems.  What you are observing is the max value hrStorageSize can report despite it being an Integer32 object type.

http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en&translate=Translate&objectInput=1.3.6.1.2.1.25.2.3.1.5

There is nothing  you can do to fix it.  In these cases the standard MIB-2 OIDs are of little use so you'll have to go about it a different route in order to get what you want.

This involves creating a custom oid within your snmp config that is tied to a shell script that runs the necessary commands to output the values you want.   Use a script that parses the output from a df, du, fdisk, etc. command and dumps it out in a nice, SNMP friendly way (read: no decimals or multiple values).

To do this (and I'm assuming you're on a linux box since you're using freenas), you use something called agent extension.  http://en.doc.centreon.com/HowToUseSNMPAgentExtension

hope this helps.  its also great to get at information where there is no oid that contains the data you want, but you still want to use snmp.
0
 
LVL 31

Author Closing Comment

by:Frosty555
ID: 39233289
Yep, just seems like a limitation of SNMP.

I think I'm going to have to use an alternative monitoring technique for these particular hosts - maybe an SSH or NRPE based check, instead of using SNMP.

You are right in that I could implement an SNMP agent extension instead... but that might be more work than it is worth since Centreon isn't absolutely limited to only using SNMP.
0

Featured Post

Cyber Threats to Small Businesses (Part 1)

This past May, Webroot surveyed more than 600 IT decision-makers at medium-sized companies to see how these small businesses perceived new threats facing their organizations.  Read what Webroot CISO, Gary Hayslip, has to say about the survey in part 1 of this 2-part blog series.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When we purchase storage, we typically are advertised storage of 500GB, 1TB, 2TB and so on. However, when you actually install it into your computer, your 500GB HDD will actually show up as 465GB. Why? It has to do with the way people and computers…
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question