Commit version 24.12.13800

This commit is contained in:
2025-01-06 17:35:06 -05:00
parent b7f6a79c2c
commit 55d9218816
6133 changed files with 4239740 additions and 1374287 deletions

View File

@ -6,7 +6,7 @@
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2020 Observium Limited
* @copyright (C) Adam Armstrong
*
*/
@ -69,350 +69,323 @@ RADLAN-PHY-MIB::rlPhyTestGetStatus.49.rlPhyTestTableLOS2 = INTEGER: success(2)
RADLAN-PHY-MIB::rlPhyTestGetStatus.49.rlPhyTestTableLOS3 = INTEGER: success(2)
*/
$oids = snmpwalk_cache_twopart_oid($device, 'rlPhyTestGetResult', [], 'RADLAN-PHY-MIB');
$oids = snmpwalk_cache_twopart_oid($device, 'rlPhyTestGetStatus', $oids, 'RADLAN-PHY-MIB');
$oids = snmpwalk_cache_twopart_oid($device, 'rlPhyTestGetResult', [], 'RADLAN-PHY-MIB');
$oids = snmpwalk_cache_twopart_oid($device, 'rlPhyTestGetStatus', $oids, 'RADLAN-PHY-MIB');
$new_oids = [];
foreach ($oids as $index => $entry)
{
// Skip all non-dom entries
if (!isset($entry['rlPhyTestTableTransceiverTemp']) || $entry['rlPhyTestTableTransceiverTemp']['rlPhyTestGetResult'] == 0) { continue; }
foreach ($oids as $index => $entry) {
// Skip all non-dom entries
if (!isset($entry['rlPhyTestTableTransceiverTemp']) || $entry['rlPhyTestTableTransceiverTemp']['rlPhyTestGetResult'] == 0) {
continue;
}
$new_oids[$index] = $entry;
$new_oids[$index] = $entry;
// Detect multilane
$multilane = FALSE;
if (isset($entry['rlPhyTestTableRxOpticalPower1']) && in_array($entry['rlPhyTestTableRxOpticalPower1']['rlPhyTestGetStatus'], [ 'success', 'inProgress' ]))
{
// FIXME. Seems as incorrectly report as multi-lane
//$multilane = TRUE;
}
$new_oids[$index]['multilane'] = $multilane;
// Detect multilane
$multilane = FALSE;
if (isset($entry['rlPhyTestTableRxOpticalPower1']) && in_array($entry['rlPhyTestTableRxOpticalPower1']['rlPhyTestGetStatus'], ['success', 'inProgress'])) {
// FIXME. Seems as incorrectly report as multi-lane
//$multilane = TRUE;
}
$new_oids[$index]['multilane'] = $multilane;
}
if (count($new_oids) == 0)
{
// Stop walk if not exist DOM sensors
return;
if (count($new_oids) == 0) {
// Stop walk if not exist DOM sensors
return;
}
// Get additional OIDs
$oids = snmpwalk_cache_twopart_oid($device, 'rlPhyTestGetUnits', $oids, 'RADLAN-PHY-MIB');
$oids = snmpwalk_cache_twopart_oid($device, 'rlPhyTestGetUnits', $oids, 'RADLAN-PHY-MIB');
// Vendor specific
$extra_oids = [];
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE))
{
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdType.49.temperature = INTEGER: temperature(0)
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdType.49.supply = INTEGER: supply(1)
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdType.49.txBias = INTEGER: txBias(2)
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdType.49.txOutput = INTEGER: txOutput(3)
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdType.49.rxOpticalPower = INTEGER: txOutput(3)
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighAlarm.49.temperature = INTEGER: 90
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighAlarm.49.supply = INTEGER: 3600000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighAlarm.49.txBias = INTEGER: 65000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighAlarm.49.txOutput = INTEGER: 999
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighAlarm.49.rxOpticalPower = INTEGER: 999
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighWarning.49.temperature = INTEGER: 85
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighWarning.49.supply = INTEGER: 3500000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighWarning.49.txBias = INTEGER: 55000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighWarning.49.txOutput = INTEGER: -3000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighWarning.49.rxOpticalPower = INTEGER: -3000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowWarning.49.temperature = INTEGER: -5
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowWarning.49.supply = INTEGER: 3100000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowWarning.49.txBias = INTEGER: 3000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowWarning.49.txOutput = INTEGER: -9501
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowWarning.49.rxOpticalPower = INTEGER: -18997
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowAlarm.49.temperature = INTEGER: -10
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowAlarm.49.supply = INTEGER: 3000000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowAlarm.49.txBias = INTEGER: 1000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowAlarm.49.txOutput = INTEGER: -13497
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowAlarm.49.rxOpticalPower = INTEGER: -23011
$oids = snmpwalk_cache_twopart_oid($device, 'eltPhdTransceiverThresholdTable', $oids, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB');
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE)) {
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdType.49.temperature = INTEGER: temperature(0)
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdType.49.supply = INTEGER: supply(1)
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdType.49.txBias = INTEGER: txBias(2)
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdType.49.txOutput = INTEGER: txOutput(3)
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdType.49.rxOpticalPower = INTEGER: txOutput(3)
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighAlarm.49.temperature = INTEGER: 90
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighAlarm.49.supply = INTEGER: 3600000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighAlarm.49.txBias = INTEGER: 65000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighAlarm.49.txOutput = INTEGER: 999
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighAlarm.49.rxOpticalPower = INTEGER: 999
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighWarning.49.temperature = INTEGER: 85
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighWarning.49.supply = INTEGER: 3500000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighWarning.49.txBias = INTEGER: 55000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighWarning.49.txOutput = INTEGER: -3000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdHighWarning.49.rxOpticalPower = INTEGER: -3000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowWarning.49.temperature = INTEGER: -5
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowWarning.49.supply = INTEGER: 3100000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowWarning.49.txBias = INTEGER: 3000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowWarning.49.txOutput = INTEGER: -9501
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowWarning.49.rxOpticalPower = INTEGER: -18997
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowAlarm.49.temperature = INTEGER: -10
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowAlarm.49.supply = INTEGER: 3000000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowAlarm.49.txBias = INTEGER: 1000
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowAlarm.49.txOutput = INTEGER: -13497
// ELTEX-MES-PHYSICAL-DESCRIPTION-MIB::eltPhdTransceiverThresholdLowAlarm.49.rxOpticalPower = INTEGER: -23011
$oids = snmpwalk_cache_twopart_oid($device, 'eltPhdTransceiverThresholdTable', $oids, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB');
}
print_debug_vars($oids);
foreach ($new_oids as $ifIndex => $entry1)
{
$multilane = $entry1['multilane'];
foreach ($oids[$ifIndex] as $oid_name => $entry)
{
if (!in_array($entry['rlPhyTestGetStatus'], [ 'success', 'inProgress' ])) { continue; }
foreach ($new_oids as $ifIndex => $entry1) {
$multilane = $entry1['multilane'];
foreach ($oids[$ifIndex] as $oid_name => $entry) {
if (!in_array($entry['rlPhyTestGetStatus'], ['success', 'inProgress'])) {
continue;
}
switch ($entry['rlPhyTestGetUnits'])
{
case 'microVolt':
case 'microAmper':
case 'microOham':
case 'microWatt':
$scale = si_to_scale('micro');
break;
case 'milidbm':
$scale = si_to_scale('milli');
break;
case 'decidbm':
$scale = si_to_scale('deci');
break;
default:
$scale = 1;
if (str_starts_with($entry['rlPhyTestGetUnits'], 'micro')) {
$scale = si_to_scale('micro');
} elseif (str_starts_with($entry['rlPhyTestGetUnits'], 'mili')) {
$scale = si_to_scale('milli');
} elseif (str_starts_with($entry['rlPhyTestGetUnits'], 'deci')) {
$scale = si_to_scale('deci');
} else {
$scale = 1;
}
$entry['ifIndex'] = $ifIndex;
$match = ['measured_match' => ['entity_type' => 'port', 'field' => 'ifIndex', 'match' => '%ifIndex%']];
$options = entity_measured_match_definition($device, $match, $entry);
//print_debug_vars($options);
$name = $options['port_label'];
switch ($oid_name) {
case 'rlPhyTestTableTransceiverTemp':
$descr = $name . " Temperature";
$index = $ifIndex . '.5';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'temperature';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE)) {
$entry_limits = $oids[$ifIndex]['temperature'];
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'];
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'];
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'];
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'];
}
break;
case 'rlPhyTestTableTransceiverSupply':
$descr = $name . " Voltage";
$index = $ifIndex . '.6';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'voltage';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE)) {
// microVolt
$entry_limits = $oids[$ifIndex]['supply'];
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.000001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.000001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.000001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.000001;
}
break;
case 'rlPhyTestTableTxBias':
if ($multilane) {
$name .= " Lane 1";
}
$descr = $name . " Tx Bias";
$index = $ifIndex . '.7';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'current';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE)) {
// microAmper
$entry_limits = $oids[$ifIndex]['txBias'];
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.000001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.000001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.000001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.000001;
}
break;
case 'rlPhyTestTableTxBias1':
if (!$multilane) {
continue 2;
} // Skip when not multi-lane
$name .= " Lane 2";
$descr = $name . " Tx Bias";
$index = $ifIndex . '.30';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'current';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE)) {
// microAmper
$entry_limits = $oids[$ifIndex]['txBias'];
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.000001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.000001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.000001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.000001;
}
break;
case 'rlPhyTestTableTxBias2':
if (!$multilane) {
continue 2;
} // Skip when not multi-lane
$name .= " Lane 3";
$descr = $name . " Tx Bias";
$index = $ifIndex . '.31';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'current';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE)) {
// microAmper
$entry_limits = $oids[$ifIndex]['txBias'];
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.000001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.000001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.000001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.000001;
}
break;
case 'rlPhyTestTableTxBias3':
if (!$multilane) {
continue 2;
} // Skip when not multi-lane
$name .= " Lane 4";
$descr = $name . " Tx Bias";
$index = $ifIndex . '.32';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'current';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE)) {
// microAmper
$entry_limits = $oids[$ifIndex]['txBias'];
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.000001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.000001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.000001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.000001;
}
break;
case 'rlPhyTestTableTxOutput':
$descr = $name . " TX Power";
$index = $ifIndex . '.8';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'dbm';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE)) {
// microWatt (really milli dBm)
$entry_limits = $oids[$ifIndex]['txOutput'];
// $options['limit_unit'] = 'W';
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.001;
}
break;
case 'rlPhyTestTableRxOpticalPower':
if ($multilane) {
$name .= " Lane 1";
}
$descr = $name . " RX Power";
$index = $ifIndex . '.9';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'dbm';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE)) {
// microWatt
$entry_limits = $oids[$ifIndex]['rxOpticalPower'];
// $options['limit_unit'] = 'W';
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.001;
}
break;
case 'rlPhyTestTableRxOpticalPower1':
if (!$multilane) {
continue 2;
} // Skip when not multi-lane
$name .= " Lane 2";
$descr = $name . " RX Power";
$index = $ifIndex . '.27';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'dbm';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE)) {
// microWatt
$entry_limits = $oids[$ifIndex]['rxOpticalPower'];
// $options['limit_unit'] = 'W';
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.001;
}
break;
case 'rlPhyTestTableRxOpticalPower2':
if (!$multilane) {
continue 2;
} // Skip when not multi-lane
$name .= " Lane 3";
$descr = $name . " RX Power";
$index = $ifIndex . '.28';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'dbm';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE)) {
// microWatt
$entry_limits = $oids[$ifIndex]['rxOpticalPower'];
// $options['limit_unit'] = 'W';
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.001;
}
break;
case 'rlPhyTestTableRxOpticalPower3':
if (!$multilane) {
continue 2;
} // Skip when not multi-lane
$name .= " Lane 4";
$descr = $name . " RX Power";
$index = $ifIndex . '.29';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'dbm';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE)) {
// microWatt
$entry_limits = $oids[$ifIndex]['rxOpticalPower'];
// $options['limit_unit'] = 'W';
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.001;
}
break;
default:
continue 2;
}
$value = $entry['rlPhyTestGetResult'];
discover_sensor_ng($device, $class, $mib, 'rlPhyTestGetResult', $oid, $index, $descr, $scale, $value, $options);
}
$entry['ifIndex'] = $ifIndex;
$match = [ 'measured_match' => [ 'entity_type' => 'port', 'field' => 'ifIndex', 'match' => '%ifIndex%' ] ];
$options = entity_measured_match_definition($device, $match, $entry);
//print_debug_vars($options);
$name = $options['port_label'];
switch ($oid_name)
{
case 'rlPhyTestTableTransceiverTemp':
$descr = $name . " Temperature";
$index = $ifIndex . '.5';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'temperature';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE))
{
$entry_limits = $oids[$ifIndex]['temperature'];
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'];
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'];
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'];
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'];
}
break;
case 'rlPhyTestTableTransceiverSupply':
$descr = $name . " Voltage";
$index = $ifIndex . '.6';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'voltage';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE))
{
// microVolt
$entry_limits = $oids[$ifIndex]['supply'];
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.000001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.000001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.000001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.000001;
}
break;
case 'rlPhyTestTableTxBias':
if ($multilane)
{
$name .= " Lane 1";
}
$descr = $name . " Tx Bias";
$index = $ifIndex . '.7';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'current';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE))
{
// microAmper
$entry_limits = $oids[$ifIndex]['txBias'];
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.000001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.000001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.000001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.000001;
}
break;
case 'rlPhyTestTableTxBias1':
if (!$multilane) { continue 2; } // Skip when not multi-lane
$name .= " Lane 2";
$descr = $name . " Tx Bias";
$index = $ifIndex . '.30';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'current';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE))
{
// microAmper
$entry_limits = $oids[$ifIndex]['txBias'];
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.000001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.000001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.000001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.000001;
}
break;
case 'rlPhyTestTableTxBias2':
if (!$multilane) { continue 2; } // Skip when not multi-lane
$name .= " Lane 3";
$descr = $name . " Tx Bias";
$index = $ifIndex . '.31';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'current';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE))
{
// microAmper
$entry_limits = $oids[$ifIndex]['txBias'];
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.000001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.000001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.000001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.000001;
}
break;
case 'rlPhyTestTableTxBias3':
if (!$multilane) { continue 2; } // Skip when not multi-lane
$name .= " Lane 4";
$descr = $name . " Tx Bias";
$index = $ifIndex . '.32';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'current';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE))
{
// microAmper
$entry_limits = $oids[$ifIndex]['txBias'];
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.000001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.000001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.000001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.000001;
}
break;
case 'rlPhyTestTableTxOutput':
$descr = $name . " TX Power";
$index = $ifIndex . '.8';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'dbm';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE))
{
// microWatt (really milli dBm)
$entry_limits = $oids[$ifIndex]['txOutput'];
// $options['limit_high'] = value_to_si($entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.000001, 'w', 'dbm');
// $options['limit_high_warn'] = value_to_si($entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.000001, 'w', 'dbm');
// $options['limit_low'] = value_to_si($entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.000001, 'w', 'dbm');
// $options['limit_low_warn'] = value_to_si($entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.000001, 'w', 'dbm');
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.001;
}
break;
case 'rlPhyTestTableRxOpticalPower':
if ($multilane)
{
$name .= " Lane 1";
}
$descr = $name . " RX Power";
$index = $ifIndex . '.9';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'dbm';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE))
{
// microWatt
$entry_limits = $oids[$ifIndex]['rxOpticalPower'];
// $options['limit_high'] = value_to_si($entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.000001, 'w', 'dbm');
// $options['limit_high_warn'] = value_to_si($entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.000001, 'w', 'dbm');
// $options['limit_low'] = value_to_si($entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.000001, 'w', 'dbm');
// $options['limit_low_warn'] = value_to_si($entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.000001, 'w', 'dbm');
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.001;
}
break;
case 'rlPhyTestTableRxOpticalPower1':
if (!$multilane) { continue 2; } // Skip when not multi-lane
$name .= " Lane 2";
$descr = $name . " RX Power";
$index = $ifIndex . '.27';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'dbm';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE))
{
// microWatt
$entry_limits = $oids[$ifIndex]['rxOpticalPower'];
// $options['limit_high'] = value_to_si($entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.000001, 'w', 'dbm');
// $options['limit_high_warn'] = value_to_si($entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.000001, 'w', 'dbm');
// $options['limit_low'] = value_to_si($entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.000001, 'w', 'dbm');
// $options['limit_low_warn'] = value_to_si($entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.000001, 'w', 'dbm');
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.001;
}
break;
case 'rlPhyTestTableRxOpticalPower2':
if (!$multilane) { continue 2; } // Skip when not multi-lane
$name .= " Lane 3";
$descr = $name . " RX Power";
$index = $ifIndex . '.28';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'dbm';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE))
{
// microWatt
$entry_limits = $oids[$ifIndex]['rxOpticalPower'];
// $options['limit_high'] = value_to_si($entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.000001, 'w', 'dbm');
// $options['limit_high_warn'] = value_to_si($entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.000001, 'w', 'dbm');
// $options['limit_low'] = value_to_si($entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.000001, 'w', 'dbm');
// $options['limit_low_warn'] = value_to_si($entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.000001, 'w', 'dbm');
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.001;
}
break;
case 'rlPhyTestTableRxOpticalPower3':
if (!$multilane) { continue 2; } // Skip when not multi-lane
$name .= " Lane 4";
$descr = $name . " RX Power";
$index = $ifIndex . '.29';
$oid = ".1.3.6.1.4.1.89.90.1.2.1.3.$index";
$class = 'dbm';
// Limits
if (is_device_mib($device, 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB', FALSE))
{
// microWatt
$entry_limits = $oids[$ifIndex]['rxOpticalPower'];
// $options['limit_high'] = value_to_si($entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.000001, 'w', 'dbm');
// $options['limit_high_warn'] = value_to_si($entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.000001, 'w', 'dbm');
// $options['limit_low'] = value_to_si($entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.000001, 'w', 'dbm');
// $options['limit_low_warn'] = value_to_si($entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.000001, 'w', 'dbm');
$options['limit_high'] = $entry_limits['eltPhdTransceiverThresholdHighAlarm'] * 0.001;
$options['limit_high_warn'] = $entry_limits['eltPhdTransceiverThresholdHighWarning'] * 0.001;
$options['limit_low'] = $entry_limits['eltPhdTransceiverThresholdLowAlarm'] * 0.001;
$options['limit_low_warn'] = $entry_limits['eltPhdTransceiverThresholdLowWarning'] * 0.001;
}
break;
default:
continue 2;
}
$value = $entry['rlPhyTestGetResult'];
discover_sensor_ng($device, $class, $mib, 'rlPhyTestGetResult', $oid, $index, NULL, $descr, $scale, $value, $options);
}
}
// EOF