diff --git a/lib/towerops/snmp.ex b/lib/towerops/snmp.ex index 07d04276..1c82cc22 100644 --- a/lib/towerops/snmp.ex +++ b/lib/towerops/snmp.ex @@ -1721,7 +1721,12 @@ defmodule Towerops.Snmp do defp build_node_lookup(devices, nodes) do # Create maps for matching by different attributes by_id = Map.new(nodes, &{&1.id, &1}) - by_name = Map.new(nodes, &{String.downcase(&1.label), &1.id}) + + by_name = + nodes + |> Enum.filter(&(&1.label != nil)) + |> Map.new(&{String.downcase(&1.label), &1.id}) + by_ip = Map.new(nodes, fn node -> {node.ip_address, node.id} end) # Build MAC address lookup from SNMP devices