This article applies to PRTG Network Monitor 15 or later
Negative or Invalid Disk Free Values with SNMP
Negative and obviously incorrect disk free values when you monitor via SNMP are not an issue that is related to PRTG. These strange disk values might rather be a result of the history. The good news is that there are some workarounds possible to get correct disk data nevertheless.
Introductory History Lesson
The hrStorageTable which holds the information about memory and disk (storage systems) is part of the HOST-RESOURCES-MIB which was published around the year 1993 and revised in the year 2000. Back in 2000 there was no S-ATA standard, no huge disks nor popular RAID systems.
The way that MIB is implemented, a disks's size and utilization is calculated using three distinct readings. The table below lists some typical values that this table contains:
Property | Value | Unit | OID |
hrStorageAllocationUnits | 4096 | Bytes | 1.3.6.1.2.1.25.2.3.1.4 |
hrStorageSize | 60533503 | AllocationUnits | 1.3.6.1.2.1.25.2.3.1.5 |
hrStorageUsed | 13423262 | AllocationUnits | 1.3.6.1.2.1.25.2.3.1.6 |
Any storage hardware would have a hrStorageAllocationUnits in bytes, as well as hrStorageSize and hrStorageUsed (in hrStorageAllocationUnits). In the above example, the values provided by the HOST-RESOURCES-MIB tells us that this storage device has a size of 60533503*4096 bytes which translates as a drive that can hold 247.945 GB.
That's not an issue so far, with the exception of one detail:
The hrStorageSize and hrStorageUsed values are reported as 32-bit Signed Integers, which imposes a maximum limit of 2147483647 (times the size of the allocation units).
This means that if your disk exceeds that size (8.79 TB with 4096 byte sectors), you will see negative values for size or used capacity. On systems with 1024 byte allocation units, the issue will arise with 2 TB disks.
Solutions to Negative Disk Free Values
You can try the following workarounds to avoid negative and invalid disk free values when monitoring via SNMP:
- OS independent: One alternative that works on any operating system is increasing the size of the hrStorageAllocationUnits: On Microsoft Windows this means formatting/partitioning the hard drive and using larger allocation units like 16 KB, 32 KB or 64 KB, because this allows the SNMP agent to report larger disk volumes.
- Linux only: Some flavors of Linux allow you to tweak the SNMP agent of the operating system, so that it automatically reports an "fictional" hrStorageAllocationUnits to get a correct end-result. More details are available in the snmpd.conf(5) - Linux man page, specifically in the Host Resources Group section.
- Linux only 2(New!): Soon-to-be released PRTG version 16.1.23 includes improvements to the SNMP Linux Disk Free Sensor which will allow it to query multi-TB volumes without issues. The sensor will need to be re-created to support large volumes after update to version 16.1.23. Please note that this sensor uses information from the UCD-SNMP-MIB which may not be compatible with all systems/distros.
- Other: Some devices which are expected to have large volumes from the beginning (storage systems, SANs, and similar devices) may also implement proprietary MIBs that report the values in gigabytes or other alternative forms to completely circumvent the issue. In this case, grab the device's MIB and add a custom SNMP Library Sensor.
Add comment