mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fixed negative values for storage: http://munin-monitoring.org/ticket/1371
This commit is contained in:
@@ -9,6 +9,8 @@ if (is_array($hrstorage_array))
|
||||
{
|
||||
$fstype = $storage['hrStorageType'];
|
||||
$descr = $storage['hrStorageDescr'];
|
||||
$storage['hrStorageSize'] = fix_integer_value($storage['hrStorageSize']);
|
||||
$storage['hrStorageUsed'] = fix_integer_value($storage['hrStorageUsed']);
|
||||
$size = $storage['hrStorageSize'] * $storage['hrStorageAllocationUnits'];
|
||||
$used = $storage['hrStorageUsed'] * $storage['hrStorageAllocationUnits'];
|
||||
$units = $storage['hrStorageAllocationUnits'];
|
||||
|
@@ -1201,3 +1201,12 @@ function first_oid_match($device, $list) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function fix_integer_value($value) {
|
||||
if ($value < 0) {
|
||||
$return = 4294967296+$value;
|
||||
} else {
|
||||
$return = $value;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
@@ -11,8 +11,10 @@ if (!is_array($storage_cache['hrstorage']))
|
||||
$entry = $storage_cache['hrstorage'][$storage[storage_index]];
|
||||
|
||||
$storage['units'] = $entry['hrStorageAllocationUnits'];
|
||||
$entry['hrStorageUsed'] = fix_integer_value($entry['hrStorageUsed']);
|
||||
$entry['hrStorageSize'] = fix_integer_value($entry['hrStorageSize']);
|
||||
$storage['used'] = $entry['hrStorageUsed'] * $storage['units'];
|
||||
$storage['size'] = $entry['hrStorageSize'] * $storage['units'];
|
||||
$storage['free'] = $storage['size'] - $storage['used'];
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Reference in New Issue
Block a user