Solved

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

Posted on 2013-05-27
2
1,879 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 500 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Transparency shows that a company is the kind of business that it wants people to think it is.
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now