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.
This commit is contained in:
Graham McIntire 2026-02-06 13:48:26 -06:00 committed by Graham McIntire
parent 3b0c2a36dd
commit 7f7b722965
No known key found for this signature in database

View file

@ -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,