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
This commit is contained in:
parent
b83484acf8
commit
d783afa14a
1 changed files with 7 additions and 35 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue