2010-03-11 02:53:17 +00:00
|
|
|
<?php
|
|
|
|
|
2011-03-15 12:04:26 +00:00
|
|
|
$oid = $mempool['mempool_index'];
|
2010-03-11 02:53:17 +00:00
|
|
|
|
2012-05-25 11:29:53 +00:00
|
|
|
/// FIXME snmp_get
|
2012-05-15 13:45:26 +00:00
|
|
|
$pool_cmd = $config['snmpget'] . " -M ".$config['mibdir']. " -m CISCO-ENHANCED-MEMPOOL-MIB -O Uqnv " . snmp_gen_auth($device) . " " . $device['hostname'].":".$device['port'];
|
2011-03-15 12:04:26 +00:00
|
|
|
$pool_cmd .= " cempMemPoolUsed.$oid cempMemPoolFree.$oid cempMemPoolLargestFree.$oid";
|
|
|
|
$pool_cmd .= " | cut -f 1 -d ' '";
|
2010-03-11 02:53:17 +00:00
|
|
|
|
2011-03-16 01:11:27 +00:00
|
|
|
if ($debug) { echo("SNMP [ $pool_cmd ]\n"); }
|
2010-03-11 02:53:17 +00:00
|
|
|
|
2011-03-15 12:04:26 +00:00
|
|
|
$pool = shell_exec($pool_cmd);
|
2010-03-11 02:53:17 +00:00
|
|
|
|
2011-03-15 12:04:26 +00:00
|
|
|
list($mempool['used'], $mempool['free'], $mempool['largestfree']) = explode("\n", $pool);
|
|
|
|
$mempool['total'] = $mempool['used'] + $mempool['free'];
|
2010-03-11 02:53:17 +00:00
|
|
|
|
2012-05-15 13:45:26 +00:00
|
|
|
?>
|