Solved

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

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
new cisco 3750 switch setup 2 27
How can I measure the quality of my Internet access? 2 49
Raid 0 2 61
Windows Server: configure snmp security to accept subnet 7 19
Is your computer hacked? learn how to detect and delete malware in your PC
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.:

777 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