42 lines
1.4 KiB
PHP
42 lines
1.4 KiB
PHP
<?php
|
|
/**
|
|
* Observium
|
|
*
|
|
* This file is part of Observium.
|
|
*
|
|
* @package observium
|
|
* @subpackage discovery
|
|
* @copyright (C) Adam Armstrong
|
|
*
|
|
*/
|
|
|
|
// Force10 M-Series
|
|
|
|
$mempool_array = snmpwalk_cache_oid($device, 'chStackUnitMemUsageUtil', [], $mib);
|
|
if (!safe_empty($mempool_array)) {
|
|
$mempool_array = snmpwalk_cache_oid($device, 'chStackUnitSysType', $mempool_array, $mib);
|
|
$total_array = snmpwalk_cache_oid($device, 'chSysProcessorMemSize', [], $mib);
|
|
print_debug_vars($total_array);
|
|
|
|
foreach ($mempool_array as $index => $entry) {
|
|
if (is_numeric($entry['chStackUnitMemUsageUtil'])) {
|
|
if (is_numeric($total_array[$index]['chSysProcessorMemSize'])) {
|
|
$precision = 1024 * 1024;
|
|
$total = $total_array[$index]['chSysProcessorMemSize']; // FTOS display memory in MB
|
|
//$total *= $precision;
|
|
} else {
|
|
$precision = 1;
|
|
$total = 1090519040; // Hardcoded total.
|
|
}
|
|
$percent = $entry['chStackUnitMemUsageUtil'];
|
|
$used = $total * $percent / 100;
|
|
$descr = 'Unit ' . ($index - 1) . ' ' . $entry['chStackUnitSysType'];
|
|
discover_mempool($valid['mempool'], $device, $index, 'F10-M-SERIES-CHASSIS-MIB', $descr, $precision, $total, $used);
|
|
}
|
|
}
|
|
}
|
|
|
|
unset($mempool_array, $total_array, $index, $descr, $precision, $total, $used, $percent);
|
|
|
|
// EOF
|