2010-07-30 13:18:12 +00:00
|
|
|
<?php
|
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
// NETSWITCH-MIB::hpGlobalMemSlotIndex.1 = INTEGER: 1
|
|
|
|
// NETSWITCH-MIB::hpGlobalMemSlabCnt.1 = Counter32: 3966
|
|
|
|
// NETSWITCH-MIB::hpGlobalMemFreeSegCnt.1 = Counter32: 166
|
|
|
|
// NETSWITCH-MIB::hpGlobalMemAllocSegCnt.1 = Counter32: 3803
|
|
|
|
// NETSWITCH-MIB::hpGlobalMemTotalBytes.1 = INTEGER: 11337704
|
|
|
|
// NETSWITCH-MIB::hpGlobalMemFreeBytes.1 = INTEGER: 9669104
|
|
|
|
// NETSWITCH-MIB::hpGlobalMemAllocBytes.1 = INTEGER: 1668728
|
|
|
|
if (!is_array($mempool_cache['hpGlobal'])) {
|
|
|
|
$mempool_cache['hpGlobal'] = snmpwalk_cache_oid($device, 'hpGlobal', null, 'NETSWITCH-MIB', $config['mibdir'].':'.$config['mibdir'].'/hp');
|
2015-08-20 15:02:40 +02:00
|
|
|
d_echo($mempool_cache);
|
2011-03-16 17:57:40 +00:00
|
|
|
}
|
2015-07-13 20:10:26 +02:00
|
|
|
else {
|
2015-08-20 15:02:40 +02:00
|
|
|
d_echo('Cached!');
|
2011-03-15 12:04:26 +00:00
|
|
|
}
|
2010-07-30 13:18:12 +00:00
|
|
|
|
2010-08-11 17:08:56 +00:00
|
|
|
$entry = $mempool_cache['hpGlobal'][$mempool[mempool_index]];
|
2010-07-30 13:18:12 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$mempool['units'] = '1';
|
2010-07-30 13:18:12 +00:00
|
|
|
$mempool['used'] = $entry['hpGlobalMemAllocBytes'];
|
|
|
|
$mempool['total'] = $entry['hpGlobalMemTotalBytes'];
|
|
|
|
$mempool['free'] = $entry['hpGlobalMemFreeBytes'];
|