Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-05-27
2
Medium Priority
?
2,140 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
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

Ready for your healthcare security check-up?

In the past few years, healthcare organizations have become a prime target for advanced attacks. Does your organization have what it needs to defend itself? Schedule your healthcare security check-up today and download our free Healthcare Security Resource Kit today!

Question has a verified solution.

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

David Varnum recently wrote up his impressions of PRTG, based on a presentation by my colleague Christian at Tech Field Day at VMworld in Barcelona. Thanks David, for your detailed and honest evaluation!
Use of TCL script on Cisco devices:  - create file and merge it with running configuration to apply configuration changes
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses

886 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