2019-03-06 04:35:58 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
$oid = $mempool['mempool_index'];
|
|
|
|
|
|
|
|
|
|
d_echo('Patton SN Mempool');
|
|
|
|
|
|
2020-09-21 15:43:38 +02:00
|
|
|
if (! is_array($mempool_cache['patton-sn'])) {
|
2019-03-06 04:35:58 +01:00
|
|
|
d_echo('caching');
|
|
|
|
|
|
|
|
|
|
$mempool_cache['patton-sn'] = [];
|
|
|
|
|
$mempool_cache['patton-sn'] = snmpwalk_cache_multi_oid($device, 'memAllocatedBytes', $mempool_cache['patton-sn'], 'SMARTNODE-MIB', 'patton');
|
|
|
|
|
$mempool_cache['patton-sn'] = snmpwalk_cache_multi_oid($device, 'memFreeBytes', $mempool_cache['patton-sn'], 'SMARTNODE-MIB', 'patton');
|
|
|
|
|
d_echo($mempool_cache);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$entry = $mempool_cache['patton-sn'][$mempool['mempool_index']];
|
|
|
|
|
|
|
|
|
|
if ($entry['hwEntityMemSize'] < 0) {
|
|
|
|
|
$entry['hwEntityMemSize'] = ($entry['hwEntityMemSize'] * -1);
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-21 15:43:38 +02:00
|
|
|
$mempool['total'] = $entry['memAllocatedBytes'] + $entry['memFreeBytes'];
|
|
|
|
|
$mempool['used'] = $entry['memAllocatedBytes'];
|
|
|
|
|
$mempool['free'] = $entry['memFreeBytes'];
|
|
|
|
|
$perc = $entry['used'] / $entry['total'] * 100;
|
2019-03-06 04:35:58 +01:00
|
|
|
|
|
|
|
|
d_echo($mempool);
|