Hi all,
i have an issue while defining a new state sensor.
I have to fetch the OID
1.3.6.1.4.1.38111.7.1.9.0.{{index}}
Possible values are:
LosAlarm(0),
RAIAlarm(1),
AISAlarm(2),
SignalAlarm(3),
Active(4),
Disable(5)
LibreNMS correctly fetch value 4:
Data E1Port0:
array (
0 =>
array (
'E1Port0' => '4',
),
)
Sensor fetched value: 4
But it stores in DB value 0 (LosAlarm)
SQL[INSERT IGNORE INTO `sensors_to_state_indexes` (`sensor_id`,`state_index_id`) VALUES (:sensor_id,:state_index_id) {"sensor_id":497,"state_index_id":28} 0.43ms]
array (
'E1Port0' =>
array (
'E1Port0.0' => 1,
),
)
SQL[SELECT * FROM sensors AS S, devices AS D WHERE S.sensor_class=? AND S.device_id = D.device_id AND D.device_id = ? AND S.poller_type = ? ["state",27,"snmp"] 0.37ms]
E1Port0.0 -> E1Port0
I can’t get rid of this.
I attach the YAML definition:
mib: VOIP-MTG2000-3000-MIB
modules:
sensors:
state:
data:
-
oid: 'E1Port0'
num_oid: '1.3.6.1.4.1.38111.7.1.9.0.{{ $index }}'
descr: 'E1Port0 Status'
state_name: E1Port0
index: 'E1Port0.{{ $index }}'
states:
- { descr: 'signal_alarm', value: 5, generic: 1, graph: 0 }
- { descr: 'normal', value: 4, generic: 0, graph: 0 }
- { descr: 'signal_alarm', value: 3, generic: 2, graph: 0 }
- { descr: 'ais_alarm', value: 2, generic: 2, graph: 0 }
- { descr: 'rai_alarm', value: 1, generic: 2, graph: 0 }
- { descr: 'los_alarm', value: 0, generic: 2, graph: 0 }