From 492dc74c9a3e26e3404f2bb9fe427eed75cf4dd4 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Mon, 26 Jan 2026 13:39:46 -0600 Subject: [PATCH] fix network map --- lib/towerops/snmp.ex | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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