Skip to content

Commit

Permalink
Corrected index for EXOS sensors (librenms#16928)
Browse files Browse the repository at this point in the history
* Corrected index for EXOS sensors

* Updated yaml discovery and test data
  • Loading branch information
laf authored Jan 3, 2025
1 parent 0f23ba5 commit 738496e
Show file tree
Hide file tree
Showing 7 changed files with 8,082 additions and 223 deletions.
9 changes: 9 additions & 0 deletions includes/definitions/discovery/exos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ modules:
descr: 'Connectivity Unit State'
index: 'connUnitState.{{ $index }}'
state_name: connUnitState
snmp_flags: ['-OteQUsab']
states:
- { value: 2, generic: 0, graph: 0, descr: Online }
- { value: 3, generic: 2, graph: 0, descr: Offline }
Expand All @@ -24,6 +25,7 @@ modules:
descr: 'Connectivity Unit Status'
index: 'connUnitStatus.{{ $index }}'
state_name: connUnitStatus
snmp_flags: ['-OteQUsab']
states:
- { value: 1, generic: 3, graph: 0, descr: none }
- { value: 2, generic: 3, graph: 0, descr: Unused }
Expand All @@ -37,6 +39,12 @@ modules:
descr: 'Principal Unit'
index: 'connUnitPrincipal.{{ $index }}'
state_name: connUnitPrincipal
snmp_flags: ['-OteQUsab']
skip_values:
-
oid: connUnitPrincipal
op: '='
value: 1
states:
- { value: 1, generic: 3, graph: 0, descr: Unknown }
- { value: 2, generic: 0, graph: 0, descr: No }
Expand All @@ -48,6 +56,7 @@ modules:
descr: '{{ $connUnitSensorName }}'
index: 'connUnitSensorName.{{ $index }}'
state_name: connUnitSensorName
snmp_flags: ['-OteQUsab']
states:
- { value: 1, generic: 3, graph: 0, descr: Unknown }
- { value: 2, generic: 3, graph: 0, descr: Other }
Expand Down
2 changes: 1 addition & 1 deletion includes/discovery/sensors/current/exos.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
foreach ($pre_cache['exos']['connUnitSensorTable'] as $index => $entry) {
if (preg_match('/Current.* ([: 0-9\.]+A)/', $entry['connUnitSensorMessage'], $temp_value)) {
$value = str_replace('A', '', $temp_value[1]);
discover_sensor($valid['sensor'], 'current', $device, ".1.3.6.1.3.94.1.8.1.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.{$entry['connUnitSensorIndex']}", $entry['connUnitSensorIndex'], 'exos', $entry['connUnitSensorName'], 1, '1', null, null, null, null, $value);
discover_sensor($valid['sensor'], 'current', $device, ".1.3.6.1.3.94.1.8.1.6.{$index}", $entry['connUnitSensorIndex'], 'exos', $entry['connUnitSensorName'], 1, '1', null, null, null, null, $value);
}
}
}
2 changes: 1 addition & 1 deletion includes/discovery/sensors/pre-cache/exos.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php

echo 'connUnitSensorTable ';
$pre_cache['exos']['connUnitSensorTable'] = snmpwalk_cache_multi_oid($device, 'connUnitSensorTable', [], 'FCMGMT-MIB');
$pre_cache['exos']['connUnitSensorTable'] = snmpwalk_cache_multi_oid($device, 'connUnitSensorTable', [], 'FCMGMT-MIB', null, '-OteQUsab');
2 changes: 1 addition & 1 deletion includes/discovery/sensors/temperature/exos.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
foreach ($pre_cache['exos']['connUnitSensorTable'] as $index => $entry) {
if (preg_match('/ Temp.* ([: 0-9]+ C)/', $entry['connUnitSensorMessage'], $temp_value)) {
[$value, $dump] = explode(' ', $temp_value[1]);
discover_sensor($valid['sensor'], 'temperature', $device, ".1.3.6.1.3.94.1.8.1.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.{$entry['connUnitSensorIndex']}", $entry['connUnitSensorIndex'], 'exos', $entry['connUnitSensorName'], 1, '1', null, null, null, null, $value);
discover_sensor($valid['sensor'], 'temperature', $device, ".1.3.6.1.3.94.1.8.1.6.{$index}", $entry['connUnitSensorIndex'], 'exos', $entry['connUnitSensorName'], 1, '1', null, null, null, null, $value);
}
}
}
2 changes: 1 addition & 1 deletion includes/discovery/sensors/voltage/exos.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
foreach ($pre_cache['exos']['connUnitSensorTable'] as $index => $entry) {
if (preg_match('/Voltage.* ([: 0-9\.]+V)/', $entry['connUnitSensorMessage'], $temp_value)) {
$value = str_replace('V', '', $temp_value[1]);
discover_sensor($valid['sensor'], 'voltage', $device, ".1.3.6.1.3.94.1.8.1.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.{$entry['connUnitSensorIndex']}", $entry['connUnitSensorIndex'], 'exos', $entry['connUnitSensorName'], 1, '1', null, null, null, null, $value);
discover_sensor($valid['sensor'], 'voltage', $device, ".1.3.6.1.3.94.1.8.1.6.{$index}", $entry['connUnitSensorIndex'], 'exos', $entry['connUnitSensorName'], 1, '1', null, null, null, null, $value);
}
}
}
Loading

0 comments on commit 738496e

Please sign in to comment.