fix: correct airfiber SNMP OIDs to match MIB table definitions

All 7 OIDs were reading from wrong SNMP table/columns. Frequency and
power config values pointed at the status table instead of the config
table, and capacity/signal columns pointed at unrelated fields like
radio temperature and boolean flags.

Corrected OIDs to match UBNT-AirFIBER-MIB structure:
- Frequency/power: config table (.3.1) entries 5, 6, 9
- Signal: status table (.3.2) entries 11, 14
- Capacity: status table (.3.2) entries 5, 6 with 1M divisor
This commit is contained in:
Graham McIntire 2026-03-10 16:41:14 -05:00
parent 91a051f14d
commit 9b3ffa874a
No known key found for this signature in database
2 changed files with 32 additions and 24 deletions

View file

@ -49,42 +49,43 @@ defmodule Towerops.Snmp.Profiles.Vendors.Airfiber do
end
# UBNT-AirFIBER-MIB OIDs for regular AirFiber devices
# Enterprise OID: 1.3.6.1.4.1.41112.1.3
# Config table: 1.3.6.1.4.1.41112.1.3.1 (airFiberConfig)
# Status table: 1.3.6.1.4.1.41112.1.3.2 (airFiberStatus)
defp airfiber_wireless_oid_defs do
[
# TX Frequency (MHz)
# TX Frequency (MHz) - airFiberConfigEntry 5
%{
oid: "1.3.6.1.4.1.41112.1.3.2.1.6.1",
oid: "1.3.6.1.4.1.41112.1.3.1.1.5.1",
sensor_type: "frequency",
sensor_descr: "Tx Frequency",
sensor_unit: "MHz",
sensor_divisor: 1
},
# RX Frequency (MHz)
# RX Frequency (MHz) - airFiberConfigEntry 6
%{
oid: "1.3.6.1.4.1.41112.1.3.2.1.7.1",
oid: "1.3.6.1.4.1.41112.1.3.1.1.6.1",
sensor_type: "frequency",
sensor_descr: "Rx Frequency",
sensor_unit: "MHz",
sensor_divisor: 1
},
# TX Power (dBm)
# TX Power (dBm) - airFiberConfigEntry 9
%{
oid: "1.3.6.1.4.1.41112.1.3.2.1.8.1",
oid: "1.3.6.1.4.1.41112.1.3.1.1.9.1",
sensor_type: "power",
sensor_descr: "Tx Power",
sensor_unit: "dBm",
sensor_divisor: 1
},
# RX Power 0 (chain 0)
# RX Power 0 chain 0 (dBm) - airFiberStatusEntry 11
%{
oid: "1.3.6.1.4.1.41112.1.3.2.1.13.1",
oid: "1.3.6.1.4.1.41112.1.3.2.1.11.1",
sensor_type: "rssi",
sensor_descr: "Rx Power Chain 0",
sensor_unit: "dBm",
sensor_divisor: 1
},
# RX Power 1 (chain 1)
# RX Power 1 chain 1 (dBm) - airFiberStatusEntry 14
%{
oid: "1.3.6.1.4.1.41112.1.3.2.1.14.1",
sensor_type: "rssi",
@ -92,21 +93,21 @@ defmodule Towerops.Snmp.Profiles.Vendors.Airfiber do
sensor_unit: "dBm",
sensor_divisor: 1
},
# TX Capacity (Mbps)
# TX Capacity (bits/sec) - airFiberStatusEntry 6, convert to Mbps
%{
oid: "1.3.6.1.4.1.41112.1.3.2.1.20.1",
oid: "1.3.6.1.4.1.41112.1.3.2.1.6.1",
sensor_type: "rate",
sensor_descr: "Tx Capacity",
sensor_unit: "Mbps",
sensor_divisor: 1
sensor_divisor: 1_000_000
},
# RX Capacity (Mbps)
# RX Capacity (bits/sec) - airFiberStatusEntry 5, convert to Mbps
%{
oid: "1.3.6.1.4.1.41112.1.3.2.1.21.1",
oid: "1.3.6.1.4.1.41112.1.3.2.1.5.1",
sensor_type: "rate",
sensor_descr: "Rx Capacity",
sensor_unit: "Mbps",
sensor_divisor: 1
sensor_divisor: 1_000_000
}
]
end

View file

@ -68,14 +68,15 @@ defmodule Towerops.Snmp.Profiles.Vendors.AirfiberTest do
cond do
# LTU detection OID (should fail for regular AirFiber)
String.contains?(oid, "41112.1.10.1.2.2.0") -> {:error, :no_such_object}
# Regular AirFiber OIDs (should succeed)
String.contains?(oid, "41112.1.3.2.1.6.1") -> {:ok, 5800}
String.contains?(oid, "41112.1.3.2.1.7.1") -> {:ok, 5800}
String.contains?(oid, "41112.1.3.2.1.8.1") -> {:ok, 25}
String.contains?(oid, "41112.1.3.2.1.13.1") -> {:ok, -55}
# Config table OIDs (frequency, power)
String.contains?(oid, "41112.1.3.1.1.5.1") -> {:ok, 10_995}
String.contains?(oid, "41112.1.3.1.1.6.1") -> {:ok, 10_995}
String.contains?(oid, "41112.1.3.1.1.9.1") -> {:ok, 25}
# Status table OIDs (signal, capacity)
String.contains?(oid, "41112.1.3.2.1.11.1") -> {:ok, -55}
String.contains?(oid, "41112.1.3.2.1.14.1") -> {:ok, -56}
String.contains?(oid, "41112.1.3.2.1.20.1") -> {:ok, 450}
String.contains?(oid, "41112.1.3.2.1.21.1") -> {:ok, 450}
String.contains?(oid, "41112.1.3.2.1.6.1") -> {:ok, 684_856_960}
String.contains?(oid, "41112.1.3.2.1.5.1") -> {:ok, 686_400_640}
true -> {:error, :no_such_object}
end
end)
@ -85,9 +86,15 @@ defmodule Towerops.Snmp.Profiles.Vendors.AirfiberTest do
assert is_list(sensors)
assert length(sensors) == 7
# Verify regular AirFiber OIDs were used
# Verify config table OIDs used for frequency
freq_sensors = Enum.filter(sensors, &(&1.sensor_type == "frequency"))
assert length(freq_sensors) == 2
assert Enum.all?(freq_sensors, &(&1.last_value == 10_995.0))
# Verify capacity values stored as raw bits/sec
rate_sensors = Enum.filter(sensors, &(&1.sensor_type == "rate"))
assert length(rate_sensors) == 2
assert Enum.all?(rate_sensors, &(&1.sensor_divisor == 1_000_000))
end
test "discovers sensors from LTU device with correct OIDs" do