From 7f7b7229654ee5d683512e951c1914154bf54ede Mon Sep 17 00:00:00 2001 From: mayor Date: Fri, 6 Feb 2026 13:48:26 -0600 Subject: [PATCH] feat: add SNMPv3 credential logging for debugging Log SNMPv3 credentials being sent to agents (with passwords redacted) to help diagnose authentication issues. Shows security level, username, auth/priv protocols, and whether passwords are present. --- lib/towerops_web/channels/agent_channel.ex | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/towerops_web/channels/agent_channel.ex b/lib/towerops_web/channels/agent_channel.ex index 7c23b3cc..b483f429 100644 --- a/lib/towerops_web/channels/agent_channel.ex +++ b/lib/towerops_web/channels/agent_channel.ex @@ -490,6 +490,19 @@ defmodule ToweropsWeb.AgentChannel do end defp build_v3_snmp_device(device, snmp_config) do + Logger.info( + "Building SNMPv3 device message", + device_id: device.id, + device_name: device.name, + device_ip: device.ip_address, + security_level: snmp_config.security_level || "", + username: snmp_config.username || "", + auth_protocol: snmp_config.auth_protocol || "", + auth_password_present: !is_nil(snmp_config.auth_password) && snmp_config.auth_password != "", + priv_protocol: snmp_config.priv_protocol || "", + priv_password_present: !is_nil(snmp_config.priv_password) && snmp_config.priv_password != "" + ) + %SnmpDevice{ ip: device.ip_address, version: device.snmp_version,