Files
librenms-librenms/includes/definitions/discovery/mrv-od.yaml

293 lines
16 KiB
YAML
Raw Normal View History

Convert OS mrv-od to yaml, discover more sensors, discover entity-physical (#10266) * Dynamic entPhysicalIndex values for YamlDiscovery * Use degree symbol when displaying temperature values * Adjust SNMP options for new snmp_get_multi() The OS polling module for mrv-od was using snmpget commands with -Ovqs, rather than -OQUs, which meant that the equal sign was stripped in the snmpget output. But that equal sign is now used as the explode() delimiter so it broke the construction of the returned array for the snmp_get_multi() function. Additionally, I removed the NBS-CMMC-MIB:: prefix which is no longer returned by snmp_get_multi() as part of the OID. Now, the mrv-od.inc.php OS polling module is retrieving data from positions in the array with actual content. * Convert mrv-od to yaml, improve sensors discovery Converted sensors discovery for mrv-od to yaml, retaining all functionality for pre-cache, dbm, and temperature. Replaced specific SFF-8472 Digital Diagnostics state sensors with generic ones, given that we are now reading out detailed values through new dbm, current, voltage sensors. Reasoning: the generic Digital Diagnostics state sensors report state diagsOk, or else the worst severity level measured among all of the Digital Diagnostics values for that optical data point. You'd really only want to set a generic "alarm" so the box can report that it thinks something is wrong, whereafter a human can look at the graphs and/or the CLI to draw their conclusions about the alarm. Otherwise, things would quickly become too spammy as you are essentially duplicating every sensor across both regular measurements and state measurements. Further changes: - Increase maximum number of detected PSUs from 4 to 8 per the MIB. - State sensor to detect (in)sufficient power budget for all modules. - Use skip_values to hide state sensors with the notSupported value. - Use skip_values to hide sensors which are unsupported per the MIB, signified by the device returning special values -1 or -2147483648. - Add dBm, temperature "over" graphs to the mrv-od device header bar. * Add mrv-od entity-physical support MRV does not use the ENTITY-MIB data format, so we had to reconstruct the inventory from their proprietary format using the following tables from their NBS-CMMC-MIB: - nbsCmmcChassisTable - nbsCmmcSlotTable - nbsCmmcPortTable Additionally, since sensors didn't have their own ifindex in the NBS-CMMC-MIB, I went ahead and appended the last OID digit to the "containing" ifindex create a unique number. The same was done for the sensors in the yaml-discovery. * Test data for mrv-od, fix 2* pre-commit.php issues * Fix entPhysicalIndex returning 0 instead of null Some unit test breakage was caused by 62167ebcb which changed the code to return 0 instead of null when {{ $index }} was set as the entPhysicalIndex in the YamlDiscovery. So now we detect if it returns some value which may be interpreted as false, and if so we set null rather than 0.
2019-05-29 20:30:33 +02:00
mib: NBS-CMMC-MIB
modules:
sensors:
pre-cache:
data:
- oid:
- nbsCmmcChassisTable
- nbsCmmcSlotTable
- nbsCmmcPortTable
dbm:
options:
divisor: 1000
skip_values: -2147483648
data:
-
oid: nbsCmmcPortTable
value: nbsCmmcPortRxPower
num_oid: '.1.3.6.1.4.1.629.200.8.1.1.32.{{ $index }}'
descr: 'Port {{ $index }} Rx Power'
index: 'nbsCmmcPortRxPower.{{ $index }}'
entPhysicalIndex: '{{ $nbsCmmcPortIfIndex }}32'
-
oid: nbsCmmcPortTable
value: nbsCmmcPortTxPower
num_oid: '.1.3.6.1.4.1.629.200.8.1.1.31.{{ $index }}'
descr: 'Port {{ $index }} Tx Power'
index: 'nbsCmmcPortTxPower.{{ $index }}'
entPhysicalIndex: '{{ $nbsCmmcPortIfIndex }}31'
current:
options:
divisor: 1000000
skip_values: -1
data:
-
oid: nbsCmmcPortTable
value: nbsCmmcPortBiasAmps
num_oid: '.1.3.6.1.4.1.629.200.8.1.1.33.{{ $index }}'
descr: 'Port {{ $index }} Tx Bias Current'
index: 'nbsCmmcPortBiasAmps.{{ $index }}'
entPhysicalIndex: '{{ $nbsCmmcPortIfIndex }}33'
voltage:
options:
divisor: 1000
skip_values: -1
data:
-
oid: nbsCmmcPortTable
value: nbsCmmcPortSupplyVolts
num_oid: '.1.3.6.1.4.1.629.200.8.1.1.34.{{ $index }}'
descr: 'Port {{ $index }} Tx Supply Voltage'
index: 'nbsCmmcPortSupplyVolts.{{ $index }}'
entPhysicalIndex: '{{ $nbsCmmcPortIfIndex }}34'
temperature:
options:
skip_values: -2147483648
data:
-
oid: nbsCmmcChassisTable
value: nbsCmmcChassisTemperature
num_oid: '.1.3.6.1.4.1.629.200.6.1.1.15.{{ $index }}'
low_limit: nbsCmmcChassisTemperatureMin
high_limit: nbsCmmcChassisTemperatureLimit
descr: 'Chassis {{ $index }} Temperature'
index: 'nbsCmmcChassisTemperature.{{ $index }}'
entPhysicalIndex: '{{ $nbsCmmcChassisIfIndex }}15'
-
oid: nbsCmmcSlotTable
value: nbsCmmcSlotTemperature
num_oid: '.1.3.6.1.4.1.629.200.7.1.1.34.{{ $index }}'
descr: 'Slot {{ $index }} Temperature'
index: 'nbsCmmcSlotTemperature.{{ $index }}'
entPhysicalIndex: '{{ $nbsCmmcSlotIfIndex }}34'
-
oid: nbsCmmcPortTable
value: nbsCmmcPortTemperature
num_oid: '.1.3.6.1.4.1.629.200.8.1.1.30.{{ $index }}'
descr: 'Port {{ $index }} Temperature'
index: 'nbsCmmcPortTemperature.{{ $index }}'
entPhysicalIndex: '{{ $nbsCmmcPortIfIndex }}30'
state:
data:
-
oid: nbsCmmcPortTable
value: nbsCmmcPortDigitalDiags
num_oid: '.1.3.6.1.4.1.629.200.8.1.1.38.{{ $index }}'
descr: 'Port {{ $index }} Overall DigiDiags State'
index: 'nbsCmmcPortDigitalDiags.{{ $index }}'
skip_values: 1
entPhysicalIndex: '{{ $nbsCmmcPortIfIndex }}38'
state_name: nbsCmmcPortDigitalDiags
states:
- { value: 1, descr: notSupported, graph: 0, generic: 3 }
- { value: 2, descr: diagsOk, graph: 0, generic: 0 }
- { value: 3, descr: diagsWarning, graph: 1, generic: 1 }
- { value: 4, descr: diagsAlarm, graph: 2, generic: 2 }
-
oid: nbsCmmcChassisTable
value: nbsCmmcChassisPowerStatus
num_oid: '.1.3.6.1.4.1.629.200.6.1.1.51.{{ $index }}'
descr: 'Chassis {{ $index }} Power Budget Status'
index: 'nbsCmmcChassisPowerStatus.{{ $index }}'
skip_values: 1
entPhysicalIndex: '{{ $nbsCmmcChassisIfIndex }}51'
state_name: nbsCmmcChassisPowerStatus
states:
- { value: 1, descr: notSupported, graph: 0, generic: 3 }
- { value: 2, descr: sufficient, graph: 1, generic: 0 }
- { value: 3, descr: insufficient, graph: -1, generic: 2 }
-
oid: nbsCmmcChassisTable
value: nbsCmmcChassisPS1Status
num_oid: '.1.3.6.1.4.1.629.200.6.1.1.7.{{ $index }}'
descr: 'Chassis {{ $index }} Power Supply 1'
index: 'nbsCmmcChassisPS1Status.{{ $index }}'
skip_values: 6
entPhysicalIndex: '{{ $nbsCmmcChassisIfIndex }}7'
state_name: nbsCmmcChassisPSStatus
states:
- { value: 1, descr: notInstalled, graph: 0, generic: 2 }
- { value: 2, descr: acBad, graph: -1, generic: 2 }
- { value: 3, descr: dcBad, graph: -1, generic: 2 }
- { value: 4, descr: acGood, graph: 1, generic: 0 }
- { value: 5, descr: dcGood, graph: 1, generic: 0 }
- { value: 6, descr: notSupported, graph: 0, generic: 3 }
- { value: 7, descr: good, graph: 1, generic: 0 }
- { value: 8, descr: bad, graph: -1, generic: 2 }
-
oid: nbsCmmcChassisTable
value: nbsCmmcChassisPS2Status
num_oid: '.1.3.6.1.4.1.629.200.6.1.1.8.{{ $index }}'
descr: 'Chassis {{ $index }} Power Supply 2'
index: 'nbsCmmcChassisPS2Status.{{ $index }}'
skip_values: 6
entPhysicalIndex: '{{ $nbsCmmcChassisIfIndex }}8'
state_name: nbsCmmcChassisPSStatus
states:
- { value: 1, descr: notInstalled, graph: 0, generic: 2 }
- { value: 2, descr: acBad, graph: -1, generic: 2 }
- { value: 3, descr: dcBad, graph: -1, generic: 2 }
- { value: 4, descr: acGood, graph: 1, generic: 0 }
- { value: 5, descr: dcGood, graph: 1, generic: 0 }
- { value: 6, descr: notSupported, graph: 0, generic: 3 }
- { value: 7, descr: good, graph: 1, generic: 0 }
- { value: 8, descr: bad, graph: -1, generic: 2 }
-
oid: nbsCmmcChassisTable
value: nbsCmmcChassisPS3Status
num_oid: '.1.3.6.1.4.1.629.200.6.1.1.9.{{ $index }}'
descr: 'Chassis {{ $index }} Power Supply 3'
index: 'nbsCmmcChassisPS3Status.{{ $index }}'
skip_values: 6
entPhysicalIndex: '{{ $nbsCmmcChassisIfIndex }}9'
state_name: nbsCmmcChassisPSStatus
states:
- { value: 1, descr: notInstalled, graph: 0, generic: 2 }
- { value: 2, descr: acBad, graph: -1, generic: 2 }
- { value: 3, descr: dcBad, graph: -1, generic: 2 }
- { value: 4, descr: acGood, graph: 1, generic: 0 }
- { value: 5, descr: dcGood, graph: 1, generic: 0 }
- { value: 6, descr: notSupported, graph: 0, generic: 3 }
- { value: 7, descr: good, graph: 1, generic: 0 }
- { value: 8, descr: bad, graph: -1, generic: 2 }
-
oid: nbsCmmcChassisTable
value: nbsCmmcChassisPS4Status
num_oid: '.1.3.6.1.4.1.629.200.6.1.1.10.{{ $index }}'
descr: 'Chassis {{ $index }} Power Supply 4'
index: 'nbsCmmcChassisPS4Status.{{ $index }}'
skip_values: 6
entPhysicalIndex: '{{ $nbsCmmcChassisIfIndex }}10'
state_name: nbsCmmcChassisPSStatus
states:
- { value: 1, descr: notInstalled, graph: 0, generic: 2 }
- { value: 2, descr: acBad, graph: -1, generic: 2 }
- { value: 3, descr: dcBad, graph: -1, generic: 2 }
- { value: 4, descr: acGood, graph: 1, generic: 0 }
- { value: 5, descr: dcGood, graph: 1, generic: 0 }
- { value: 6, descr: notSupported, graph: 0, generic: 3 }
- { value: 7, descr: good, graph: 1, generic: 0 }
- { value: 8, descr: bad, graph: -1, generic: 2 }
-
oid: nbsCmmcChassisTable
value: nbsCmmcChassisFan1Status
num_oid: '.1.3.6.1.4.1.629.200.6.1.1.11.{{ $index }}'
descr: 'Chassis {{ $index }} Fan 1'
index: 'nbsCmmcChassisFan1Status.{{ $index }}'
skip_values: 1
entPhysicalIndex: '{{ $nbsCmmcChassisIfIndex }}11'
state_name: nbsCmmcChassisFanStatus
states:
- { value: 1, descr: notSupported, graph: 0, generic: 3 }
- { value: 2, descr: bad, graph: -1, generic: 2 }
- { value: 3, descr: good, graph: 1, generic: 0 }
- { value: 4, descr: notInstalled, graph: 0, generic: 2 }
-
oid: nbsCmmcChassisTable
value: nbsCmmcChassisFan2Status
num_oid: '.1.3.6.1.4.1.629.200.6.1.1.12.{{ $index }}'
descr: 'Chassis {{ $index }} Fan 2'
index: 'nbsCmmcChassisFan2Status.{{ $index }}'
skip_values: 1
entPhysicalIndex: '{{ $nbsCmmcChassisIfIndex }}12'
state_name: nbsCmmcChassisFanStatus
states:
- { value: 1, descr: notSupported, graph: 0, generic: 3 }
- { value: 2, descr: bad, graph: -1, generic: 2 }
- { value: 3, descr: good, graph: 1, generic: 0 }
- { value: 4, descr: notInstalled, graph: 0, generic: 2 }
-
oid: nbsCmmcChassisTable
value: nbsCmmcChassisFan3Status
num_oid: '.1.3.6.1.4.1.629.200.6.1.1.13.{{ $index }}'
descr: 'Chassis {{ $index }} Fan 3'
index: 'nbsCmmcChassisFan3Status.{{ $index }}'
skip_values: 1
entPhysicalIndex: '{{ $nbsCmmcChassisIfIndex }}13'
state_name: nbsCmmcChassisFanStatus
states:
- { value: 1, descr: notSupported, graph: 0, generic: 3 }
- { value: 2, descr: bad, graph: -1, generic: 2 }
- { value: 3, descr: good, graph: 1, generic: 0 }
- { value: 4, descr: notInstalled, graph: 0, generic: 2 }
-
oid: nbsCmmcChassisTable
value: nbsCmmcChassisFan4Status
num_oid: '.1.3.6.1.4.1.629.200.6.1.1.14.{{ $index }}'
descr: 'Chassis {{ $index }} Fan 4'
index: 'nbsCmmcChassisFan4Status.{{ $index }}'
skip_values: 1
entPhysicalIndex: '{{ $nbsCmmcChassisIfIndex }}14'
state_name: nbsCmmcChassisFanStatus
states:
- { value: 1, descr: notSupported, graph: 0, generic: 3 }
- { value: 2, descr: bad, graph: -1, generic: 2 }
- { value: 3, descr: good, graph: 1, generic: 0 }
- { value: 4, descr: notInstalled, graph: 0, generic: 2 }
-
oid: nbsCmmcChassisTable
value: nbsCmmcChassisFan5Status
num_oid: '.1.3.6.1.4.1.629.200.6.1.1.36.{{ $index }}'
descr: 'Chassis {{ $index }} Fan 5'
index: 'nbsCmmcChassisFan5Status.{{ $index }}'
skip_values: 1
entPhysicalIndex: '{{ $nbsCmmcChassisIfIndex }}36'
state_name: nbsCmmcChassisFanStatus
states:
- { value: 1, descr: notSupported, graph: 0, generic: 3 }
- { value: 2, descr: bad, graph: -1, generic: 2 }
- { value: 3, descr: good, graph: 1, generic: 0 }
- { value: 4, descr: notInstalled, graph: 0, generic: 2 }
-
oid: nbsCmmcChassisTable
value: nbsCmmcChassisFan6Status
num_oid: '.1.3.6.1.4.1.629.200.6.1.1.37.{{ $index }}'
descr: 'Chassis {{ $index }} Fan 6'
index: 'nbsCmmcChassisFan6Status.{{ $index }}'
skip_values: 1
entPhysicalIndex: '{{ $nbsCmmcChassisIfIndex }}37'
state_name: nbsCmmcChassisFanStatus
states:
- { value: 1, descr: notSupported, graph: 0, generic: 3 }
- { value: 2, descr: bad, graph: -1, generic: 2 }
- { value: 3, descr: good, graph: 1, generic: 0 }
- { value: 4, descr: notInstalled, graph: 0, generic: 2 }
-
oid: nbsCmmcChassisTable
value: nbsCmmcChassisFan7Status
num_oid: '.1.3.6.1.4.1.629.200.6.1.1.38.{{ $index }}'
descr: 'Chassis {{ $index }} Fan 7'
index: 'nbsCmmcChassisFan7Status.{{ $index }}'
skip_values: 1
entPhysicalIndex: '{{ $nbsCmmcChassisIfIndex }}38'
state_name: nbsCmmcChassisFanStatus
states:
- { value: 1, descr: notSupported, graph: 0, generic: 3 }
- { value: 2, descr: bad, graph: -1, generic: 2 }
- { value: 3, descr: good, graph: 1, generic: 0 }
- { value: 4, descr: notInstalled, graph: 0, generic: 2 }
-
oid: nbsCmmcChassisTable
value: nbsCmmcChassisFan8Status
num_oid: '.1.3.6.1.4.1.629.200.6.1.1.39.{{ $index }}'
descr: 'Chassis {{ $index }} Fan 8'
index: 'nbsCmmcChassisFan8Status.{{ $index }}'
skip_values: 1
entPhysicalIndex: '{{ $nbsCmmcChassisIfIndex }}39'
state_name: nbsCmmcChassisFanStatus
states:
- { value: 1, descr: notSupported, graph: 0, generic: 3 }
- { value: 2, descr: bad, graph: -1, generic: 2 }
- { value: 3, descr: good, graph: 1, generic: 0 }
- { value: 4, descr: notInstalled, graph: 0, generic: 2 }