mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added Packetlight PL2000 support (#11782)
convert Watts to Dbm and call user_function on limits dbm graphs summary pl1000eTests update Tests OK
This commit is contained in:
@@ -19,6 +19,8 @@ modules:
|
||||
- ifDescr
|
||||
- ifAlias
|
||||
- ifAdminStatus
|
||||
- sfpConfigVendorPN
|
||||
- sfpConfigVendorSN
|
||||
temperature:
|
||||
data:
|
||||
-
|
||||
@@ -32,9 +34,9 @@ modules:
|
||||
oid: sfpDiagTable
|
||||
value: sfpDiagModuleTemperature
|
||||
num_oid: '.1.3.6.1.4.1.4515.1.10.2.1.1.34.{{ $index }}'
|
||||
descr: '{{ $ifDescr }} {{ $ifAlias }}'
|
||||
descr: '{{ $ifDescr }} {{ $ifAlias }} Temperature'
|
||||
index: 'opt-temp-{{ $index }}'
|
||||
group: 'Optics'
|
||||
group: 'Optic {{ $sfpConfigVendorPN }}, {{ $sfpConfigVendorSN }}'
|
||||
entPhysicalIndex: '{{ $index }}'
|
||||
entPhysicalIndex_measured: ports
|
||||
user_func: '\LibreNMS\OS\Packetlight::offsetSfpTemperature'
|
||||
@@ -44,6 +46,14 @@ modules:
|
||||
oid: sfpDiagModuleTemperature
|
||||
op: '='
|
||||
value: 0
|
||||
-
|
||||
oid: sfpDiagModuleTemperature
|
||||
op: '='
|
||||
value: 32768
|
||||
-
|
||||
oid: sfpDiagModuleTemperature
|
||||
op: '='
|
||||
value: -32768
|
||||
count:
|
||||
data:
|
||||
-
|
||||
@@ -87,6 +97,48 @@ modules:
|
||||
entPhysicalIndex_measured: ports
|
||||
index: 'edfaOperOutputPower-{{ $index }}'
|
||||
group: '{{ $edfaFreeDescription }}'
|
||||
-
|
||||
oid: sfpDiagTable
|
||||
value: sfpDiagTxOutputPower
|
||||
num_oid: '.1.3.6.1.4.1.4515.1.10.2.1.1.37.{{ $index }}'
|
||||
descr: '{{ $ifDescr }} Tx'
|
||||
entPhysicalIndex: '{{ $index }}'
|
||||
entPhysicalIndex_measured: ports
|
||||
index: 'txout-{{ $index }}'
|
||||
group: 'Optic {{ $sfpConfigVendorPN }}, {{ $sfpConfigVendorSN }}'
|
||||
high_limit: sfpDiagHighTxPowerAlmThreshold
|
||||
low_limit: sfpDiagLowTxPowerAlmThreshold
|
||||
user_func: '\LibreNMS\OS\Packetlight::convertWattToDbm'
|
||||
skip_values:
|
||||
-
|
||||
oid: ifAdminStatus
|
||||
op: '!='
|
||||
value: 1
|
||||
-
|
||||
oid: sfpDiagHighTxPowerAlmThreshold
|
||||
op: '='
|
||||
value: 0
|
||||
-
|
||||
oid: sfpDiagTable
|
||||
value: sfpDiagRxInputPower
|
||||
num_oid: '.1.3.6.1.4.1.4515.1.10.2.1.1.38.{{ $index }}'
|
||||
descr: '{{ $ifDescr }} Rx'
|
||||
entPhysicalIndex: '{{ $index }}'
|
||||
entPhysicalIndex_measured: ports
|
||||
index: 'Rxin-{{ $index }}'
|
||||
group: 'Optic {{ $sfpConfigVendorPN }}, {{ $sfpConfigVendorSN }}'
|
||||
high_limit: sfpDiagHighRxPowerAlmThreshold
|
||||
low_limit: sfpDiagLowRxPowerAlmThreshold
|
||||
user_func: '\LibreNMS\OS\Packetlight::convertWattToDbm'
|
||||
skip_values:
|
||||
-
|
||||
oid: ifAdminStatus
|
||||
op: '!='
|
||||
value: 1
|
||||
-
|
||||
oid: sfpDiagHighRxPowerAlmThreshold
|
||||
op: '='
|
||||
value: 0
|
||||
quality_factor:
|
||||
data:
|
||||
-
|
||||
@@ -109,50 +161,6 @@ modules:
|
||||
divisor: 10
|
||||
index: 'edfaOpGain-{{ $index }}'
|
||||
group: '{{ $edfaFreeDescription }}'
|
||||
power:
|
||||
data:
|
||||
-
|
||||
oid: sfpDiagTable
|
||||
value: sfpDiagTxOutputPower
|
||||
num_oid: '.1.3.6.1.4.1.4515.1.10.2.1.1.37.{{ $index }}'
|
||||
descr: '{{ $ifDescr }} Tx'
|
||||
entPhysicalIndex: '{{ $index }}'
|
||||
entPhysicalIndex_measured: ports
|
||||
divisor: 10000000
|
||||
index: 'txout-{{ $index }}'
|
||||
group: '{{ $ifDescr }} {{ $ifAlias }}'
|
||||
high_limit: sfpDiagHighTxPowerAlmThreshold
|
||||
low_limit: sfpDiagLowTxPowerAlmThreshold
|
||||
skip_values:
|
||||
-
|
||||
oid: ifAdminStatus
|
||||
op: '='
|
||||
value: 2
|
||||
-
|
||||
oid: sfpDiagHighTxPowerAlmThreshold
|
||||
op: '='
|
||||
value: 0
|
||||
-
|
||||
oid: sfpDiagTable
|
||||
value: sfpDiagRxInputPower
|
||||
num_oid: '.1.3.6.1.4.1.4515.1.10.2.1.1.38.{{ $index }}'
|
||||
descr: '{{ $ifDescr }} Rx'
|
||||
entPhysicalIndex: '{{ $index }}'
|
||||
entPhysicalIndex_measured: ports
|
||||
divisor: 10000000
|
||||
index: 'Rxin-{{ $index }}'
|
||||
group: '{{ $ifDescr }} {{ $ifAlias }}'
|
||||
high_limit: sfpDiagHighRxPowerAlmThreshold
|
||||
low_limit: sfpDiagLowRxPowerAlmThreshold
|
||||
skip_values:
|
||||
-
|
||||
oid: ifAdminStatus
|
||||
op: '='
|
||||
value: 2
|
||||
-
|
||||
oid: sfpDiagHighRxPowerAlmThreshold
|
||||
op: '='
|
||||
value: 0
|
||||
state:
|
||||
data:
|
||||
-
|
||||
|
@@ -5,7 +5,7 @@ icon: packetlight
|
||||
group: packetlight
|
||||
over:
|
||||
- { graph: device_temperature, text: 'Temperature' }
|
||||
- { graph: device_power, text: 'Interface Power' }
|
||||
- { graph: device_dbm, text: 'Interface Power' }
|
||||
discovery:
|
||||
- snmpget:
|
||||
oid: '1.3.6.1.4.1.4515.1.3.6.1.1.1.2.0'
|
||||
|
@@ -1068,6 +1068,9 @@ function discovery_process(&$valid, $device, $sensor_class, $pre_cache)
|
||||
if (is_numeric($$limit)) {
|
||||
$$limit = ($$limit / $divisor) * $multiplier;
|
||||
}
|
||||
if (is_numeric($$limit) && isset($user_function) && is_callable($user_function)) {
|
||||
$$limit = $user_function($$limit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user