From 09f2907ede474bdf8c3227e27cde3803a19dbc5b Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Wed, 4 Feb 2026 12:10:48 -0600 Subject: [PATCH] Remove debugging logs, fix Mix.env call --- lib/mix/tasks/copy_mibs.ex | 2 +- lib/towerops/snmp/client.ex | 9 ++------- lib/towerops_web/channels/agent_channel.ex | 9 --------- priv/static/changelog.txt | 3 +++ 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/lib/mix/tasks/copy_mibs.ex b/lib/mix/tasks/copy_mibs.ex index 457029ac..98ce323f 100644 --- a/lib/mix/tasks/copy_mibs.ex +++ b/lib/mix/tasks/copy_mibs.ex @@ -51,7 +51,7 @@ defmodule Mix.Tasks.CopyMibs do defp get_default_target_dir do # In development, use priv/mibs; in production use /app/mibs - if Mix.env() == :dev do + if Application.get_env(:towerops, :env) == :dev do Path.join([File.cwd!(), "priv", "mibs"]) else Application.get_env(:towerops, :mib_dir, "/app/mibs") diff --git a/lib/towerops/snmp/client.ex b/lib/towerops/snmp/client.ex index a2a8dca0..b0950668 100644 --- a/lib/towerops/snmp/client.ex +++ b/lib/towerops/snmp/client.ex @@ -389,7 +389,7 @@ defmodule Towerops.Snmp.Client do defp phoenix_snmp_disabled do # Only disable in non-test environments (allow tests to run normally) - if Mix.env() == :test do + if Application.get_env(:towerops, :env) == :test do false else Application.get_env(:towerops, :disable_phoenix_snmp, true) @@ -402,12 +402,7 @@ defmodule Towerops.Snmp.Client do Logger.info(""" [Phoenix SNMP Disabled] Would have executed SNMP operation: - Operation: #{operation} - Target: #{ip} - Version: #{version} - OID/Param: #{inspect(oid_or_param)} - - This operation should be performed by an agent instead. + Operation: #{operation}, Target: #{ip}, Version: #{version}, OID/Param: #{inspect(oid_or_param)} """) end diff --git a/lib/towerops_web/channels/agent_channel.ex b/lib/towerops_web/channels/agent_channel.ex index 41be2d1b..87c8432b 100644 --- a/lib/towerops_web/channels/agent_channel.ex +++ b/lib/towerops_web/channels/agent_channel.ex @@ -398,15 +398,6 @@ defmodule ToweropsWeb.AgentChannel do defp build_v2c_snmp_device(device, snmp_config) do community = snmp_config.community || "" - Logger.info(""" - [Agent Channel] Building v2c SNMP device - Device: #{device.name} (#{device.id}) - IP: #{device.ip_address} - Version: #{device.snmp_version} - Community from config: #{inspect(snmp_config.community)} - Community to send: #{inspect(community)} - """) - %SnmpDevice{ ip: device.ip_address, version: device.snmp_version, diff --git a/priv/static/changelog.txt b/priv/static/changelog.txt index 1de7d176..45431fa7 100644 --- a/priv/static/changelog.txt +++ b/priv/static/changelog.txt @@ -3,6 +3,9 @@ Devices Tested & Working * Ubiquiti AC, LTU, AirFiber * Cambium ePMP +2026-02-04 +* Feature: SNMP v3 support + 2026-02-03 * More tests * Bug fix: user registration