Fix coding style part 2

This commit is contained in:
Job Snijders
2015-07-13 20:10:26 +02:00
parent ad9590df9b
commit d8693f05ae
733 changed files with 37359 additions and 33947 deletions

View File

@@ -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']);

View File

@@ -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']);