Solved

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

Posted on 2013-05-27
2
2,036 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 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Is your computer hacked? learn how to detect and delete malware in your PC
Use of TCL script on Cisco devices:  - create file and merge it with running configuration to apply configuration changes
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.:
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…

626 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