debug: add DevicePollerWorker client opts logging
Added logging to show what options are being built in DevicePollerWorker, including whether security_name (v3) or community (v2c) credentials are being included.
This commit is contained in:
parent
e1c4930bea
commit
197d52096d
1 changed files with 21 additions and 14 deletions
|
|
@ -1122,21 +1122,28 @@ defmodule Towerops.Workers.DevicePollerWorker do
|
|||
]
|
||||
|
||||
# Add version-specific credentials
|
||||
if snmp_config.version == "3" do
|
||||
v3_config = Devices.get_snmpv3_config(device)
|
||||
opts =
|
||||
if snmp_config.version == "3" do
|
||||
v3_config = Devices.get_snmpv3_config(device)
|
||||
|
||||
base_opts ++
|
||||
[
|
||||
security_name: v3_config.username,
|
||||
security_level: v3_config.security_level,
|
||||
auth_protocol: v3_config.auth_protocol,
|
||||
auth_password: v3_config.auth_password,
|
||||
priv_protocol: v3_config.priv_protocol,
|
||||
priv_password: v3_config.priv_password
|
||||
]
|
||||
else
|
||||
base_opts ++ [community: snmp_config.community]
|
||||
end
|
||||
base_opts ++
|
||||
[
|
||||
security_name: v3_config.username,
|
||||
security_level: v3_config.security_level,
|
||||
auth_protocol: v3_config.auth_protocol,
|
||||
auth_password: v3_config.auth_password,
|
||||
priv_protocol: v3_config.priv_protocol,
|
||||
priv_password: v3_config.priv_password
|
||||
]
|
||||
else
|
||||
base_opts ++ [community: snmp_config.community]
|
||||
end
|
||||
|
||||
Logger.info(
|
||||
"DevicePollerWorker building client opts for #{device.name} (#{device.ip_address}): version=#{snmp_config.version}, has_security_name=#{Keyword.has_key?(opts, :security_name)}, has_community=#{Keyword.has_key?(opts, :community)}"
|
||||
)
|
||||
|
||||
opts
|
||||
end
|
||||
|
||||
defp get_poll_interval(device) do
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue