librenms/includes/discovery/mempools/cmp.inc.php
Tom Laermans 0a2371cfc7 reformat mempool and current discovery
git-svn-id: http://www.observium.org/svn/observer/trunk@1834 61d68cd4-352d-0410-923a-c4978735b2b8
2011-03-14 19:24:23 +00:00

24 lines
807 B
PHP
Executable File

<?php
global $valid_mempool;
## Ignore this discovery module if we have already discovered things in CISCO-ENHANCED-MEMPOOL-MIB. Dirty duplication.
$cemp_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `mempools` WHERE `device_id` = '".$device['device_id']."' AND `mempool_type` = 'cemp'"),0);
if (($device['os'] == "ios" || $device['os_group'] == "ios") && $cemp_count == "0")
{
echo("OLD-CISCO-MEMORY-POOL: ");
$cmp_array = snmpwalk_cache_oid($device, 'ciscoMemoryPool', NULL, "CISCO-MEMORY-POOL-MIB");
if (is_array($cmp_array)) {
foreach ($cmp_array as $index => $cmp) {
if (is_numeric($cmp['ciscoMemoryPoolUsed']) && is_numeric($index)) {
discover_mempool($valid_mempool, $device, $index, "cmp", $cmp['ciscoMemoryPoolName'], "1", NULL, NULL);
}
}
}
}
?>