From 5f0549908e29a2eedbffdfdb50b62fb39cef2673 Mon Sep 17 00:00:00 2001 From: mayor Date: Fri, 6 Feb 2026 11:05:59 -0600 Subject: [PATCH] Add IP address table walks to agent discovery queries Fixes missing IP addresses tab on device page after agent-based discovery. Issue: Discovery was not collecting IP address data because the agent's discovery job didn't include IP address table OID walks. Root cause: build_discovery_queries() walked interface tables, sensors, vendor MIBs, and neighbors, but was missing the IP-MIB address tables. Changes: - Add new SnmpQuery to walk IP address tables during discovery: - 1.3.6.1.2.1.4.20 (ipAddrTable - IPv4, deprecated but widely supported) - 1.3.6.1.2.1.4.34 (ipAddressTable - RFC 4293, unified IPv4/IPv6) This matches the OIDs used by Phoenix's direct discovery in lib/towerops/snmp/profiles/base.ex discover_all_ip_addresses/1. Result: Agent now collects IP address data during discovery, which is then synced to the database and displayed in the IP Addresses tab. Tests: 5578 tests passing (1 pre-existing failure in unrelated Dahua test) --- lib/towerops_web/channels/agent_channel.ex | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/towerops_web/channels/agent_channel.ex b/lib/towerops_web/channels/agent_channel.ex index 57c7d509..2fd7c133 100644 --- a/lib/towerops_web/channels/agent_channel.ex +++ b/lib/towerops_web/channels/agent_channel.ex @@ -674,6 +674,16 @@ defmodule ToweropsWeb.AgentChannel do # Cisco CDP "1.3.6.1.4.1.9.9.23" ] + }, + # IP address discovery (WALK) + %SnmpQuery{ + query_type: :WALK, + oids: [ + # IP-MIB ipAddrTable (IPv4 - deprecated but widely supported) + "1.3.6.1.2.1.4.20", + # IP-MIB ipAddressTable (RFC 4293 - unified IPv4/IPv6) + "1.3.6.1.2.1.4.34" + ] } ] end