diff --git a/AUTHORS.md b/AUTHORS.md index d506487277..bdaf9aa6d1 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -197,6 +197,7 @@ LibreNMS contributors: - Jari Schäfer (jarischaefer) - Jan-Philipp Litza (jplitza) - Chris Putnam (putnam) +- Remy de Boer (remydb) - Ben Klang (bklang) Observium was written by: diff --git a/includes/discovery/sensors/dbm/junos.inc.php b/includes/discovery/sensors/dbm/junos.inc.php index f81fa68458..99ee350dac 100644 --- a/includes/discovery/sensors/dbm/junos.inc.php +++ b/includes/discovery/sensors/dbm/junos.inc.php @@ -40,4 +40,33 @@ foreach ($pre_cache['junos_oids'] as $index => $entry) { $entPhysicalIndex_measured = 'ports'; discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-'.$index, 'junos', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured); } + if (is_numeric($entry['jnxDomCurrentModuleLaneCount'])) { + for ($x=0; $x<$entry['jnxDomCurrentModuleLaneCount']; $x++) { + $lane = $pre_cache['junos_multilane_oids'][$index.'.'.$x]; + if (is_numeric($lane['jnxDomCurrentLaneRxLaserPower']) && $lane['jnxDomCurrentLaneRxLaserPower'] != 0 && $lane['jnxDomCurrentLaneTxLaserOutputPower'] != 0) { + $oid = '.1.3.6.1.4.1.2636.3.60.1.2.1.1.6.'.$index.'.'.$x; + $descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' lane ' . $x . ' Rx Power'; + $limit_low = $entry['jnxDomCurrentRxLaserPowerLowAlarmThreshold']/$divisor; + $warn_limit_low = $entry['jnxDomCurrentRxLaserPowerLowWarningThreshold']/$divisor; + $limit = $entry['jnxDomCurrentRxLaserPowerHighAlarmThreshold']/$divisor; + $warn_limit = $entry['jnxDomCurrentRxLaserPowerHighWarningThreshold']/$divisor; + $current = $lane['jnxDomCurrentLaneRxLaserPower']/$divisor; + $entPhysicalIndex = $index; + $entPhysicalIndex_measured = 'ports'; + discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'rx-'.$index.'.'.$x, 'junos', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured); + } + if (is_numeric($lane['jnxDomCurrentLaneTxLaserOutputPower']) && $lane['jnxDomCurrentLaneTxLaserOutputPower'] && $lane['jnxDomCurrentLaneRxLaserPower']) { + $oid = '.1.3.6.1.4.1.2636.3.60.1.2.1.1.8.'.$index.'.'.$x; + $descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' lane ' . $x . ' Tx Power'; + $limit_low = $entry['jnxDomCurrentTxLaserOutputPowerLowAlarmThreshold']/$divisor; + $warn_limit_low = $entry['jnxDomCurrentTxLaserOutputPowerLowWarningThreshold']/$divisor; + $limit = $entry['jnxDomCurrentModuleTemperatureHighAlarmThreshold']/$divisor; + $warn_limit = $entry['jnxDomCurrentModuleTemperatureHighWarningThreshold']/$divisor; + $current = $lane['jnxDomCurrentLaneTxLaserOutputPower']/$divisor; + $entPhysicalIndex = $index; + $entPhysicalIndex_measured = 'ports'; + discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-'.$index.'.'.$x, 'junos', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured); + } + } + } } diff --git a/includes/discovery/sensors/pre-cache/junos.inc.php b/includes/discovery/sensors/pre-cache/junos.inc.php index 55f2500870..09f67841df 100644 --- a/includes/discovery/sensors/pre-cache/junos.inc.php +++ b/includes/discovery/sensors/pre-cache/junos.inc.php @@ -12,5 +12,6 @@ if ($device['os'] === 'junos') { $pre_cache['junos_oids'] = snmpwalk_cache_multi_oid($device, 'JnxDomCurrentEntry', array(), 'JUNIPER-DOM-MIB', 'junos'); + $pre_cache['junos_multilane_oids'] = snmpwalk_cache_multi_oid($device, 'JnxDomCurrentLaneEntry', array(), 'JUNIPER-DOM-MIB', 'junos'); d_echo($pre_cache); }