mikrotik sensor fixes

This commit is contained in:
Graham McIntire 2026-01-25 13:24:28 -06:00
parent a23296ea34
commit 6e86f54aa0
No known key found for this signature in database
2 changed files with 9 additions and 76 deletions

View file

@ -610,7 +610,7 @@ defmodule Towerops.Snmp.Profiles.Vendors.Routeros do
defp gauge_unit_to_sensor_type(@gauge_unit_celsius), do: {"temperature", "°C", 1}
defp gauge_unit_to_sensor_type(@gauge_unit_rpm), do: {"fanspeed", "RPM", 1}
defp gauge_unit_to_sensor_type(@gauge_unit_dv), do: {"voltage", "V", 10}
defp gauge_unit_to_sensor_type(@gauge_unit_da), do: {"current", "mA", 1}
defp gauge_unit_to_sensor_type(@gauge_unit_da), do: {"current", "A", 10}
defp gauge_unit_to_sensor_type(@gauge_unit_dw), do: {"power", "W", 10}
defp gauge_unit_to_sensor_type(@gauge_unit_status), do: {"state", "", 1}
defp gauge_unit_to_sensor_type(_), do: {"unknown", "", 1}
@ -647,7 +647,7 @@ defmodule Towerops.Snmp.Profiles.Vendors.Routeros do
# Sensor type configurations for overrides (must match gauge_unit_to_sensor_type divisors)
defp sensor_type_config("voltage"), do: {"voltage", "V", 10}
defp sensor_type_config("temperature"), do: {"temperature", "°C", 1}
defp sensor_type_config("current"), do: {"current", "mA", 1}
defp sensor_type_config("current"), do: {"current", "A", 10}
defp sensor_type_config("power"), do: {"power", "W", 10}
defp sensor_type_config("fanspeed"), do: {"fanspeed", "RPM", 1}

View file

@ -18,21 +18,11 @@ modules:
value: MIKROTIK-MIB::mtxrOpticalTemperature
num_oid: '.1.3.6.1.4.1.14988.1.1.19.1.1.6.{{ $index }}'
descr: MIKROTIK-MIB::mtxrOpticalName
unit: '°C'
entPhysicalIndex: '{{ $index }}'
entPhysicalIndex_measured: 'ports'
group: transceiver
index: 'mtxrOpticalTemperature.{{ $index }}'
-
oid: MIKROTIK-MIB::mtxrGaugeTable
value: MIKROTIK-MIB::mtxrGaugeValue
num_oid: '.1.3.6.1.4.1.14988.1.1.3.100.1.3.{{ $index }}'
descr: MIKROTIK-MIB::mtxrGaugeName
group: System
index: 'mtxrGaugeTemperature.{{ $index }}'
skip_values:
- oid: MIKROTIK-MIB::mtxrGaugeUnit
op: '!='
value: 1
voltage:
data:
-
@ -40,6 +30,7 @@ modules:
value: MIKROTIK-MIB::mtxrOpticalSupplyVoltage
num_oid: '.1.3.6.1.4.1.14988.1.1.19.1.1.7.{{ $index }}'
divisor: 1000
unit: 'V'
descr: MIKROTIK-MIB::mtxrOpticalName
entPhysicalIndex: '{{ $index }}'
entPhysicalIndex_measured: 'ports'
@ -50,25 +41,15 @@ modules:
value: MIKROTIK-MIB::mtxrPOEVoltage
num_oid: '.1.3.6.1.4.1.14988.1.1.15.1.1.4.{{ $index }}'
divisor: 10
unit: 'V'
descr: '{{ MIKROTIK-MIB::mtxrPOEName }} POE'
group: Ports
index: 'mtxrPOEVoltage.{{ $index }}'
-
oid: MIKROTIK-MIB::mtxrGaugeTable
value: MIKROTIK-MIB::mtxrGaugeValue
num_oid: '.1.3.6.1.4.1.14988.1.1.3.100.1.3.{{ $index }}'
descr: MIKROTIK-MIB::mtxrGaugeName
group: System
divisor: 10
index: 'mtxrGaugeVoltage.{{ $index }}'
skip_values:
- oid: MIKROTIK-MIB::mtxrGaugeUnit
op: '!='
value: 3
-
oid: MIKROTIK-MIB::mtxrHlVoltage
num_oid: '.1.3.6.1.4.1.14988.1.1.3.8.{{ $index }}'
divisor: 10
unit: 'V'
descr: 'Voltage {{ $index }}'
current:
data:
@ -77,6 +58,7 @@ modules:
value: MIKROTIK-MIB::mtxrOpticalTxBiasCurrent
num_oid: '.1.3.6.1.4.1.14988.1.1.19.1.1.8.{{ $index }}'
descr: '{{ MIKROTIK-MIB::mtxrOpticalName }} Tx Bias'
unit: 'mA'
entPhysicalIndex: '{{ $index }}'
entPhysicalIndex_measured: 'ports'
group: transceiver
@ -87,21 +69,10 @@ modules:
value: MIKROTIK-MIB::mtxrPOECurrent
num_oid: '.1.3.6.1.4.1.14988.1.1.15.1.1.5.{{ $index }}'
descr: '{{ MIKROTIK-MIB::mtxrPOEName }} POE'
unit: 'A'
group: Ports
divisor: 1000
index: 'mtxrPOECurrent.{{ $index }}'
-
oid: MIKROTIK-MIB::mtxrGaugeTable
value: MIKROTIK-MIB::mtxrGaugeValue
num_oid: '.1.3.6.1.4.1.14988.1.1.3.100.1.3.{{ $index }}'
descr: MIKROTIK-MIB::mtxrGaugeName
group: System
divisor: 10
index: 'mtxrGaugeCurrent.{{ $index }}'
skip_values:
- oid: MIKROTIK-MIB::mtxrGaugeUnit
op: '!='
value: 4
dbm:
data:
@ -164,20 +135,6 @@ modules:
- { descr: 'waitingForLoad', graph: 1, value: 2, generic: 3 }
- { descr: 'poweredOn', graph: 1, value: 3, generic: 0 }
- { descr: 'overload', graph: 1, value: 4, generic: 2 }
-
oid: MIKROTIK-MIB::mtxrGaugeTable
value: MIKROTIK-MIB::mtxrGaugeValue
num_oid: '.1.3.6.1.4.1.14988.1.1.3.100.1.3.{{ $index }}'
descr: MIKROTIK-MIB::mtxrGaugeName
group: System
state_name: mtxrGaugeStatus
skip_values:
- oid: MIKROTIK-MIB::mtxrGaugeUnit
op: '!='
value: 6
states:
- { value: 0, generic: 0, graph: 1, descr: 'ok' }
- { value: 1, generic: 2, graph: 1, descr: 'fail' }
-
oid: MIKROTIK-MIB::mtxrWl60GConnected
num_oid: '.1.3.6.1.4.1.14988.1.1.1.8.1.4.{{ $index }}'
@ -207,34 +164,10 @@ modules:
value: MIKROTIK-MIB::mtxrPOEPower
num_oid: '.1.3.6.1.4.1.14988.1.1.15.1.1.6.{{ $index }}'
descr: '{{ MIKROTIK-MIB::mtxrPOEName }} POE'
unit: 'W'
group: Ports
divisor: 10
index: 'mtxrPOEPower.{{ $index }}'
-
oid: MIKROTIK-MIB::mtxrGaugeTable
value: MIKROTIK-MIB::mtxrGaugeValue
num_oid: '.1.3.6.1.4.1.14988.1.1.3.100.1.3.{{ $index }}'
descr: MIKROTIK-MIB::mtxrGaugeName
group: System
divisor: 10
index: 'mtxrGaugePower.{{ $index }}'
skip_values:
- oid: MIKROTIK-MIB::mtxrGaugeUnit
op: '!='
value: 5
fanspeed:
data:
-
oid: MIKROTIK-MIB::mtxrGaugeTable
value: MIKROTIK-MIB::mtxrGaugeValue
num_oid: '.1.3.6.1.4.1.14988.1.1.3.100.1.3.{{ $index }}'
descr: MIKROTIK-MIB::mtxrGaugeName
group: System
index: 'mtxrGuageFanspeed.{{ $index }}'
skip_values:
- oid: MIKROTIK-MIB::mtxrGaugeUnit
op: '!='
value: 2
count:
data:
-