mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fixed various issues with MRV OptiDriver sensor detection. (#6682)
modified: discovery/sensors/dbm/mrv-od.inc.php modified: discovery/sensors/pre-cache/mrv-od.inc.php modified: discovery/sensors/state/mrv-od.inc.php
This commit is contained in:
committed by
Neil Lathwood
parent
a86f2a2597
commit
e28eb690fe
@@ -17,8 +17,8 @@ echo 'MRV OptiDriver ';
|
||||
$multiplier = 1;
|
||||
$divisor = 1000;
|
||||
|
||||
foreach ($pre_cache['mrv-od_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['nbsCmmcPortRxPower'])) {
|
||||
foreach ($pre_cache['mrv-od_port-table'] as $index => $entry) {
|
||||
if ($entry['nbsCmmcPortRxPower']) {
|
||||
$oid = '.1.3.6.1.4.1.629.200.8.1.1.32.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifName`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Rx Power';
|
||||
$currentrx = $entry['nbsCmmcPortRxPower'];
|
||||
@@ -41,7 +41,7 @@ foreach ($pre_cache['mrv-od_oids'] as $index => $entry) {
|
||||
);
|
||||
}
|
||||
|
||||
if (is_numeric($entry['nbsCmmcPortTxPower'])) {
|
||||
if ($entry['nbsCmmcPortTxPower']) {
|
||||
$oid = '.1.3.6.1.4.1.629.200.8.1.1.31.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifName`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Tx Power';
|
||||
$currenttx = $entry['nbsCmmcPortTxPower'];
|
||||
|
||||
@@ -12,6 +12,6 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
echo 'Caching nbsCmmcPorTable and NbsCmmcChassisEntry for MRV OptiDriver ';
|
||||
echo 'Caching nbsCmmcPortTable and NbsCmmcChassisEntry for MRV OptiDriver ';
|
||||
$pre_cache['mrv-od_port-table'] = snmpwalk_cache_multi_oid($device, 'nbsCmmcPortTable', array(), 'NBS-CMMC-MIB');
|
||||
$pre_cache['mrv-od_chassis-entry'] = snmpwalk_cache_multi_oid($device, 'NbsCmmcChassisEntry', array(), 'NBS-CMMC-MIB');
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Sensor State discovery module for the MRV® OptiDriver® Optical Transport Platform
|
||||
*
|
||||
@@ -10,10 +12,10 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
<?php
|
||||
echo "MRV OptiDriver";
|
||||
|
||||
foreach ($pre_cache['mrv-od_port-table'] as $index => $entry) {
|
||||
// RX Interface Power
|
||||
// RX Interface Power State
|
||||
if ($entry['nbsCmmcPortRxPowerLevel']) {
|
||||
$cur_oid = '.1.3.6.1.4.1.629.200.8.1.1.66.';
|
||||
//Create State Index
|
||||
@@ -40,15 +42,13 @@ foreach ($pre_cache['mrv-od_port-table'] as $index => $entry) {
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
foreach ($oids as $index => $entry) {
|
||||
$descr = $oids[$index]['nbsCmmcPortName'] . ' Rx Power State';
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, $descr, '1', '1', null, null, null, null, $entry['nbsCmmcPortRxPowerLevel'], 'snmp', $index);
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifName`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Rx Power State';
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, $descr, '1', '1', null, null, null, null, $entry['nbsCmmcPortRxPowerLevel'], 'snmp', $index);
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
// RX Interface Power State
|
||||
// TX Interface Power State
|
||||
if ($entry['nbsCmmcPortTxPowerLevel']) {
|
||||
$cur_oid = '.1.3.6.1.4.1.629.200.8.1.1.65.';
|
||||
//Create State Index
|
||||
@@ -75,13 +75,11 @@ foreach ($pre_cache['mrv-od_port-table'] as $index => $entry) {
|
||||
dbInsert($insert, 'state_translations');
|
||||
}
|
||||
}
|
||||
foreach ($oids as $index => $entry) {
|
||||
$descr = $oids[$index]['nbsCmmcPortName'] . ' Tx Power State';
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, $descr, '1', '1', null, null, null, null, $entry['nbsCmmcPortTxPowerLevel'], 'snmp', $index);
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifName`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Tx Power State';
|
||||
//Discover Sensors
|
||||
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, $descr, '1', '1', null, null, null, null, $entry['nbsCmmcPortTxPowerLevel'], 'snmp', $index);
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user