reduce log level

This commit is contained in:
Graham McIntire 2026-01-28 09:22:11 -06:00
parent d34c72a0ab
commit b8cb3e4f05
2 changed files with 11 additions and 11 deletions

View file

@ -656,7 +656,7 @@ defmodule Towerops.Profiles.YamlProfiles do
defp find_best_conditional_match(profiles, sys_object_id, sys_descr, client_opts) do
profile_names = Enum.map(profiles, & &1.name)
Logger.info("Attempting conditional profile match with snmpget evaluation",
Logger.debug("Attempting conditional profile match with snmpget evaluation",
sys_object_id: sys_object_id,
sys_descr: sys_descr,
profile_count: length(profiles),
@ -678,7 +678,7 @@ defmodule Towerops.Profiles.YamlProfiles do
conditional_blocks = Enum.filter(profile.detection_blocks, fn block -> block.has_condition end)
if match_conditional && conditional_blocks != [] do
Logger.info("Checking profile with conditional blocks",
Logger.debug("Checking profile with conditional blocks",
profile_name: profile.name,
conditional_blocks: length(conditional_blocks),
total_blocks: length(profile.detection_blocks)
@ -690,7 +690,7 @@ defmodule Towerops.Profiles.YamlProfiles do
matches = block_matches?(block, sys_object_id, sys_descr, match_conditional, client_opts)
if matches && match_conditional do
Logger.info("Profile matched with conditional check",
Logger.debug("Profile matched with conditional check",
profile_name: profile.name,
oid: block.oid,
has_snmpget: block.has_snmpget,
@ -716,7 +716,7 @@ defmodule Towerops.Profiles.YamlProfiles do
matches = oid_match && condition_match && descr_match && snmpget_match
if oid_match && condition_match do
Logger.info("Block evaluation",
Logger.debug("Block evaluation",
oid: block.oid,
has_snmpget: block.has_snmpget,
has_snmpwalk: block.has_snmpwalk,
@ -785,24 +785,24 @@ defmodule Towerops.Profiles.YamlProfiles do
# Evaluate a snmpget condition by performing SNMP query
defp evaluate_snmpget_condition(%{oid: oid, op: op, value: expected}, client_opts) do
Logger.info("Evaluating snmpget condition: oid=#{oid}, op=#{op}, expected=#{inspect(expected)}")
Logger.debug("Evaluating snmpget condition: oid=#{oid}, op=#{op}, expected=#{inspect(expected)}")
# Query the OID via SNMP
case Client.get(client_opts, oid) do
{:ok, actual} ->
result = compare_snmp_values(actual, op, expected)
Logger.info("snmpget result: actual=#{inspect(actual)}, matches=#{result}")
Logger.debug("snmpget result: actual=#{inspect(actual)}, matches=#{result}")
result
{:error, reason} ->
Logger.info("snmpget query failed: #{inspect(reason)}")
Logger.debug("snmpget query failed: #{inspect(reason)}")
false
end
end
# Evaluate a snmpwalk condition by performing SNMP walk
defp evaluate_snmpwalk_condition(%{oid: oid, op: op, value: expected}, client_opts) do
Logger.info("Evaluating snmpwalk condition: oid=#{oid}, op=#{op}, expected=#{inspect(expected)}")
Logger.debug("Evaluating snmpwalk condition: oid=#{oid}, op=#{op}, expected=#{inspect(expected)}")
# Walk the OID via SNMP to get all values
case Client.walk(client_opts, oid) do
@ -811,11 +811,11 @@ defmodule Towerops.Profiles.YamlProfiles do
values = Enum.map(results, fn %{value: value} -> value end)
# Check if any value matches the condition
result = Enum.any?(values, fn value -> compare_snmp_values(value, op, expected) end)
Logger.info("snmpwalk result: found #{length(values)} values, matches=#{result}")
Logger.debug("snmpwalk result: found #{length(values)} values, matches=#{result}")
result
{:error, reason} ->
Logger.info("snmpwalk query failed: #{inspect(reason)}")
Logger.debug("snmpwalk query failed: #{inspect(reason)}")
false
end
end

View file

@ -333,7 +333,7 @@ defmodule Towerops.Workers.DiscoveryWorker do
case Snmp.discover_device(device) do
{:ok, _snmp_device} ->
Logger.info(
Logger.debug(
"Direct SNMP discovery completed successfully from Phoenix cluster",
device_id: device.id,
device_name: device.name