diff --git a/includes/discovery/discovery-protocols.inc.php b/includes/discovery/discovery-protocols.inc.php index 343cf9f0aa..17dbfe4623 100644 --- a/includes/discovery/discovery-protocols.inc.php +++ b/includes/discovery/discovery-protocols.inc.php @@ -96,7 +96,8 @@ unset($lldp_array); if ($device['os'] == 'pbn' && $config['autodiscovery']['xdp'] === true) { echo ' NMS-LLDP-MIB: '; - $lldp_array = snmpwalk_cache_oid($device, 'lldpRemoteSystemsData', array(), 'NMS-LLDP-MIB'); + $mibdir = $config['mibdir'].'/pbn'.':'.$config['mibdir']; + $lldp_array = snmpwalk_cache_oid($device, 'lldpRemoteSystemsData', array(), 'NMS-LLDP-MIB', $mibdir); d_echo($lldp_array); if ($lldp_array) { unset($lldp_links); diff --git a/includes/discovery/mempools/pbn.inc.php b/includes/discovery/mempools/pbn.inc.php index 1a95b81148..1737cc7957 100644 --- a/includes/discovery/mempools/pbn.inc.php +++ b/includes/discovery/mempools/pbn.inc.php @@ -10,7 +10,8 @@ if ($device['os'] == 'pbn') { // specified MIB supported since build 16607 if ($version[build] >= 16607) { - $usage = snmp_get($device, 'NMS-MEMORY-POOL-MIB::nmsMemoryPoolUtilization.0', '-OUvQ'); + $mibdir = $config['mibdir'].'/pbn'.':'.$config['mibdir']; + $usage = snmp_get($device, 'nmsMemoryPoolUtilization.0', '-OUvQ', 'NMS-MEMORY-POOL-MIB', $mibdir); if (is_numeric($usage)) { discover_mempool($valid_mempool, $device, 0, 'pbn-mem', 'Main Memory', '100', null, null); diff --git a/includes/discovery/processors/pbn.inc.php b/includes/discovery/processors/pbn.inc.php index ada6c6cbdd..ada86365b1 100644 --- a/includes/discovery/processors/pbn.inc.php +++ b/includes/discovery/processors/pbn.inc.php @@ -11,7 +11,8 @@ if ($device['os'] == 'pbn') { echo 'PBN : '; $descr = 'Processor'; - $usage = snmp_get($device, 'NMS-PROCESS-MIB::nmspmCPUTotal5min.1', '-OUvQ'); + $mibdir = $config['mibdir'].'/pbn'.':'.$config['mibdir']; + $usage = snmp_get($device, 'nmspmCPUTotal5min.1', '-OUvQ', 'NMS-PROCESS-MIB', $mibdir); if (is_numeric($usage)) { discover_processor($valid['processor'], $device, 'NMS-PROCESS-MIB::nmspmCPUTotal5min', '0', 'pbn-cpu', $descr, '100', $usage, null, null); diff --git a/includes/polling/functions.inc.php b/includes/polling/functions.inc.php index a6fbfa4594..e917a7cf6f 100644 --- a/includes/polling/functions.inc.php +++ b/includes/polling/functions.inc.php @@ -10,6 +10,13 @@ function poll_sensor($device, $class, $unit) { $sensor_value = ''; if ($sensor['poller_type'] == 'snmp') { + if ($device['os'] == 'pbn') { + $mibdir = $config['mibdir'].'/pbn'.':'.$config['mibdir']; + } + else { + $mibdir = $config['mibdir']; + } + if ($device['os'] == 'siklu') { $mib = ':RADIO-BRIDGE-MIB'; } @@ -29,7 +36,7 @@ function poll_sensor($device, $class, $unit) { for ($i = 0; $i < 5; $i++) { d_echo("Attempt $i "); - $sensor_value = trim(str_replace('"', '', snmp_get($device, $sensor['sensor_oid'], '-OUqnv', "SNMPv2-MIB$mib"))); + $sensor_value = trim(str_replace('"', '', snmp_get($device, $sensor['sensor_oid'], '-OUqnv', "SNMPv2-MIB$mib", $mibdir))); preg_match('/[\d\.]+/', $sensor_value, $temp_response); if (!empty($temp_response[0])) { $sensor_value = $temp_response[0]; @@ -44,7 +51,7 @@ function poll_sensor($device, $class, $unit) { }//end if } else if ($class == 'state') { - $sensor_value = trim(str_replace('"', '', snmp_walk($device, $sensor['sensor_oid'], '-Oevq', 'SNMPv2-MIB'))); + $sensor_value = trim(str_replace('"', '', snmp_walk($device, $sensor['sensor_oid'], '-Oevq', 'SNMPv2-MIB', $mibdir))); if (!is_numeric($sensor_value)) { $state_value = dbFetchCell('SELECT `state_value` FROM `state_translations` LEFT JOIN `sensors_to_state_indexes` ON `state_translations`.`state_index_id` = `sensors_to_state_indexes`.`state_index_id` WHERE `sensors_to_state_indexes`.`sensor_id` = ? AND `state_translations`.`state_descr` LIKE ?', array($sensor['sensor_id'], $sensor_value)); d_echo('State value of ' . $sensor_value . ' is ' . $state_value . "\n"); @@ -56,10 +63,10 @@ function poll_sensor($device, $class, $unit) { else if ($class == 'signal') { $currentOS = $device['os']; include "includes/polling/signal/$currentOS.inc.php"; - $sensor_value = trim(str_replace('"', '', snmp_get($device, $sensor['sensor_oid'], '-OUqnv', "SNMPv2-MIB$mib"))); + $sensor_value = trim(str_replace('"', '', snmp_get($device, $sensor['sensor_oid'], '-OUqnv', "SNMPv2-MIB$mib", $mibdir))); } else if ($class == 'dbm') { - $sensor_value = trim(str_replace('"', '', snmp_get($device, $sensor['sensor_oid'], '-OUqnv', "SNMPv2-MIB$mib"))); + $sensor_value = trim(str_replace('"', '', snmp_get($device, $sensor['sensor_oid'], '-OUqnv', "SNMPv2-MIB$mib", $mibdir))); //iosxr does not expose dbm values through SNMP so we convert Watts to dbm to have a nice graph to show if ($device['os'] == "iosxr") { $sensor_value = round(10*log10($sensor_value/1000),3); @@ -67,13 +74,14 @@ function poll_sensor($device, $class, $unit) { } else { if ($sensor['sensor_type'] == 'apc') { - $sensor_value = trim(str_replace('"', '', snmp_walk($device, $sensor['sensor_oid'], '-OUqnv', "SNMPv2-MIB:PowerNet-MIB$mib"))); + $sensor_value = trim(str_replace('"', '', snmp_walk($device, $sensor['sensor_oid'], '-OUqnv', "SNMPv2-MIB:PowerNet-MIB$mib", $mibdir))); } else { - $sensor_value = trim(str_replace('"', '', snmp_get($device, $sensor['sensor_oid'], '-OUqnv', "SNMPv2-MIB$mib"))); + $sensor_value = trim(str_replace('"', '', snmp_get($device, $sensor['sensor_oid'], '-OUqnv', "SNMPv2-MIB$mib", $mibdir))); } }//end if unset($mib); + unset($mibdir); } else if ($sensor['poller_type'] == 'agent') { if (isset($agent_sensors)) { diff --git a/includes/polling/mempools/pbn-mem.inc.php b/includes/polling/mempools/pbn-mem.inc.php index c078426725..1947efd364 100644 --- a/includes/polling/mempools/pbn-mem.inc.php +++ b/includes/polling/mempools/pbn-mem.inc.php @@ -10,8 +10,9 @@ if ($device['os'] == 'pbn') { // specified MIB supported since build 16607 if ($version[build] >= 16607) { - $perc = snmp_get($device, "NMS-MEMORY-POOL-MIB::nmsMemoryPoolUtilization.0", '-OUvQ'); - $memory_available = snmp_get($device, "NMS-MEMORY-POOL-MIB::nmsMemoryPoolTotalMemorySize.0", '-OUvQ'); + $mibdir = $config['mibdir'].'/pbn'.':'.$config['mibdir']; + $perc = snmp_get($device, 'nmsMemoryPoolUtilization.0', '-OUvQ', 'NMS-MEMORY-POOL-MIB', $mibdir); + $memory_available = snmp_get($device, 'nmsMemoryPoolTotalMemorySize.0', '-OUvQ', 'NMS-MEMORY-POOL-MIB', $mibdir); $mempool['total'] = $memory_available; if (is_numeric($perc)) { diff --git a/includes/polling/processors/pbn-cpu.inc.php b/includes/polling/processors/pbn-cpu.inc.php index d97d86fa6a..bbe42892b1 100644 --- a/includes/polling/processors/pbn-cpu.inc.php +++ b/includes/polling/processors/pbn-cpu.inc.php @@ -11,7 +11,8 @@ if ($device['os'] == 'pbn') { // specified MIB supported since build 16607 if ($version[build] >= 16607) { - $usage = snmp_get($device, 'NMS-PROCESS-MIB::nmspmCPUTotal5min.1', '-OUvQ'); + $mibdir = $config['mibdir'].'/pbn'.':'.$config['mibdir']; + $usage = snmp_get($device, 'nmspmCPUTotal5min.1', '-OUvQ', 'NMS-PROCESS-MIB', $mibdir); if (is_numeric($usage)) { $proc = ($usage * 100); diff --git a/mibs/NMS-IF-MIB.MIB b/mibs/pbn/NMS-IF-MIB.MIB similarity index 100% rename from mibs/NMS-IF-MIB.MIB rename to mibs/pbn/NMS-IF-MIB.MIB diff --git a/mibs/NMS-LLDP b/mibs/pbn/NMS-LLDP similarity index 100% rename from mibs/NMS-LLDP rename to mibs/pbn/NMS-LLDP diff --git a/mibs/NMS-MEMORY-POOL-MIB.MIB b/mibs/pbn/NMS-MEMORY-POOL-MIB.MIB similarity index 100% rename from mibs/NMS-MEMORY-POOL-MIB.MIB rename to mibs/pbn/NMS-MEMORY-POOL-MIB.MIB diff --git a/mibs/NMS-PROCESS-MIB.MIB b/mibs/pbn/NMS-PROCESS-MIB.MIB similarity index 100% rename from mibs/NMS-PROCESS-MIB.MIB rename to mibs/pbn/NMS-PROCESS-MIB.MIB diff --git a/mibs/NMS-QOS-PIB-MIB.MIB b/mibs/pbn/NMS-QOS-PIB-MIB.MIB similarity index 100% rename from mibs/NMS-QOS-PIB-MIB.MIB rename to mibs/pbn/NMS-QOS-PIB-MIB.MIB diff --git a/mibs/NMS-SMI b/mibs/pbn/NMS-SMI similarity index 100% rename from mibs/NMS-SMI rename to mibs/pbn/NMS-SMI diff --git a/mibs/NMS-TC.MIB b/mibs/pbn/NMS-TC.MIB similarity index 100% rename from mibs/NMS-TC.MIB rename to mibs/pbn/NMS-TC.MIB diff --git a/mibs/PBN-MIB b/mibs/pbn/PBN-MIB similarity index 100% rename from mibs/PBN-MIB rename to mibs/pbn/PBN-MIB diff --git a/mibs/PBN-ROOT b/mibs/pbn/PBN-ROOT similarity index 100% rename from mibs/PBN-ROOT rename to mibs/pbn/PBN-ROOT