Improve error logging for SNMP result validation failures
Add detailed error logging to show specific validation error type and
message when SNMP results fail validation. Also handle base64 decode
failures separately.
This will help diagnose validation issues introduced by recent strict
protobuf validation changes (commit 8044a6d1).
This commit is contained in:
parent
0a978746e1
commit
a4dd7210d8
1 changed files with 11 additions and 2 deletions
|
|
@ -254,10 +254,19 @@ defmodule ToweropsWeb.AgentChannel do
|
||||||
{:noreply, socket}
|
{:noreply, socket}
|
||||||
else
|
else
|
||||||
{:error, {type, message}} ->
|
{:error, {type, message}} ->
|
||||||
Logger.error("Invalid SNMP result from agent",
|
Logger.error("Invalid SNMP result from agent: #{type} - #{message}",
|
||||||
agent_token_id: socket.assigns.agent_token_id,
|
agent_token_id: socket.assigns.agent_token_id,
|
||||||
error_type: type,
|
error_type: type,
|
||||||
error_message: message
|
error_message: message,
|
||||||
|
binary_size: byte_size(binary_b64)
|
||||||
|
)
|
||||||
|
|
||||||
|
{:noreply, socket}
|
||||||
|
|
||||||
|
{:error, :base64_decode_failed} ->
|
||||||
|
Logger.error("Failed to decode SNMP result (invalid base64)",
|
||||||
|
agent_token_id: socket.assigns.agent_token_id,
|
||||||
|
binary_size: byte_size(binary_b64)
|
||||||
)
|
)
|
||||||
|
|
||||||
{:noreply, socket}
|
{:noreply, socket}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue