mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix coding style part 2
This commit is contained in:
@@ -1,20 +1,18 @@
|
||||
<?php
|
||||
|
||||
// HOST-RESOURCES-MIB - Storage Objects
|
||||
|
||||
if (!is_array($storage_cache['hrstorage']))
|
||||
{
|
||||
$storage_cache['hrstorage'] = snmpwalk_cache_oid($device, "hrStorageEntry", NULL, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES");
|
||||
if ($debug) { print_r($storage_cache); }
|
||||
if (!is_array($storage_cache['hrstorage'])) {
|
||||
$storage_cache['hrstorage'] = snmpwalk_cache_oid($device, 'hrStorageEntry', null, 'HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES');
|
||||
if ($debug) {
|
||||
print_r($storage_cache);
|
||||
}
|
||||
}
|
||||
|
||||
$entry = $storage_cache['hrstorage'][$storage[storage_index]];
|
||||
|
||||
$storage['units'] = $entry['hrStorageAllocationUnits'];
|
||||
$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'];
|
||||
|
||||
?>
|
||||
$storage['used'] = ($entry['hrStorageUsed'] * $storage['units']);
|
||||
$storage['size'] = ($entry['hrStorageSize'] * $storage['units']);
|
||||
$storage['free'] = ($storage['size'] - $storage['used']);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
if (!is_array($storage_cache['netapp-storage'])) {
|
||||
$storage_cache['netapp-storage'] = snmpwalk_cache_oid($device, "dfEntry", NULL, "NETAPP-MIB");
|
||||
$storage_cache['netapp-storage'] = snmpwalk_cache_oid($device, 'dfEntry', null, 'NETAPP-MIB');
|
||||
if ($debug) {
|
||||
print_r($storage_cache);
|
||||
}
|
||||
@@ -11,10 +11,12 @@ $entry = $storage_cache['netapp-storage'][$storage[storage_index]];
|
||||
|
||||
$storage['units'] = 1024;
|
||||
if (isset($entry['df64TotalKBytes']) && is_numeric($entry['df64TotalKBytes'])) {
|
||||
$storage['used'] = $entry['df64UsedKBytes'] * $storage['units'];
|
||||
$storage['size'] = $entry['df64TotalKBytes'] * $storage['units'];
|
||||
} else {
|
||||
$storage['used'] = $entry['dfKBytesUsed'] * $storage['units'];
|
||||
$storage['size'] = $entry['dfKBytesTotal'] * $storage['units'];
|
||||
$storage['used'] = ($entry['df64UsedKBytes'] * $storage['units']);
|
||||
$storage['size'] = ($entry['df64TotalKBytes'] * $storage['units']);
|
||||
}
|
||||
$storage['free'] = $storage['size'] - $storage['used'];
|
||||
else {
|
||||
$storage['used'] = ($entry['dfKBytesUsed'] * $storage['units']);
|
||||
$storage['size'] = ($entry['dfKBytesTotal'] * $storage['units']);
|
||||
}
|
||||
|
||||
$storage['free'] = ($storage['size'] - $storage['used']);
|
||||
|
Reference in New Issue
Block a user