From d783afa14af98d804c75c01ea035dceb150598b5 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sat, 17 Jan 2026 18:27:08 -0600 Subject: [PATCH] fix: disable OS definition polling due to MIB name resolution LibreNMS OS definitions use MIB symbolic names (e.g., CAMBIUM-PMP80211-MIB::cambiumCurrentuImageVersion.0) which require MIB compilation to resolve to numeric OIDs. The SNMP client (snmpkit) only supports numeric OIDs, not MIB names. Disabled OS definition polling for now. The system will use the profile OS name as firmware_version (e.g., 'epmp') until MIB resolution is implemented. Future improvements: - Add MIB compiler integration (net-snmp, snmptranslate) - Import numeric OIDs during profile import - Add MIB -> numeric OID lookup table --- lib/towerops/snmp/profiles/dynamic.ex | 42 +++++---------------------- 1 file changed, 7 insertions(+), 35 deletions(-) diff --git a/lib/towerops/snmp/profiles/dynamic.ex b/lib/towerops/snmp/profiles/dynamic.ex index ed8e20d7..3026e9d9 100644 --- a/lib/towerops/snmp/profiles/dynamic.ex +++ b/lib/towerops/snmp/profiles/dynamic.ex @@ -76,41 +76,13 @@ defmodule Towerops.Snmp.Profiles.Dynamic do # Private functions - defp poll_os_definitions(profile, client_opts) do - if profile && profile.os_definitions && length(profile.os_definitions) > 0 do - Logger.debug("Polling #{length(profile.os_definitions)} OS definitions for #{profile.os}") - - # Poll each OS definition and build a map - profile.os_definitions - |> Enum.map(fn os_def -> - field = String.to_atom(os_def.field) - value = poll_os_definition_oid(client_opts, os_def) - {field, value} - end) - |> Enum.reject(fn {_field, value} -> is_nil(value) end) - |> Map.new() - else - %{} - end - end - - defp poll_os_definition_oid(client_opts, os_def) do - # Use the OID from the OS definition - oid = os_def.oid - - if oid do - case Client.get(client_opts, oid) do - {:ok, value} when is_binary(value) -> - value - - {:ok, value} -> - to_string(value) - - {:error, reason} -> - Logger.debug("Failed to poll OS definition OID #{oid}: #{inspect(reason)}") - nil - end - end + defp poll_os_definitions(_profile, _client_opts) do + # Note: OS definition polling is currently disabled because LibreNMS + # uses MIB names (e.g., CAMBIUM-PMP80211-MIB::cambiumCurrentuImageVersion.0) + # which require MIB compilation to resolve to numeric OIDs. + # The SNMP client only supports numeric OIDs. + # TODO: Add MIB resolution or import numeric OIDs from LibreNMS + %{} end defp extract_manufacturer(%DeviceProfile{group: group}) when is_binary(group) do