2010-02-22 00:57:13 +00:00
|
|
|
<?php
|
|
|
|
|
2011-03-15 12:04:26 +00:00
|
|
|
$oid = $mempool['mempool_index'];
|
2010-02-22 00:57:13 +00:00
|
|
|
|
2012-05-25 12:24:34 +00:00
|
|
|
// FIXME snmp_get
|
2015-07-13 20:10:26 +02:00
|
|
|
$pool_cmd = $config['snmpget'].' -M '.$config['mibdir'].' -m CISCO-MEMORY-POOL-MIB -O Uqnv '.snmp_gen_auth($device).' '.$device['hostname'].':'.$device['port'];
|
2011-03-15 12:04:26 +00:00
|
|
|
$pool_cmd .= " ciscoMemoryPoolUsed.$oid ciscoMemoryPoolFree.$oid ciscoMemoryPoolLargestFree.$oid";
|
|
|
|
$pool_cmd .= " | cut -f 1 -d ' '";
|
2010-02-22 00:57:13 +00:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
if ($debug) {
|
|
|
|
echo "$pool_cmd";
|
|
|
|
}
|
2010-02-22 00:57:13 +00:00
|
|
|
|
2011-03-15 12:04:26 +00:00
|
|
|
$pool = shell_exec($pool_cmd);
|
2010-02-22 00:57:13 +00:00
|
|
|
|
2011-03-15 12:04:26 +00:00
|
|
|
list($mempool['used'], $mempool['free'], $mempool['largestfree']) = explode("\n", $pool);
|
2015-07-13 20:10:26 +02:00
|
|
|
$mempool['total'] = ($mempool['used'] + $mempool['free']);
|