fix: Use snmp_device.id for sync_processors and sync_storage
Fixes KeyError when processing processors/storage during agent polling.
The sync_processors and sync_storage functions expect device.id to be
the snmp_device id, not the main device id.
Changed from:
%{device_id: device.id}
To:
%{id: device.snmp_device.id}
This matches the expected structure for these sync functions which
query where snmp_device_id == device.id.
This commit is contained in:
parent
c6ec9ab891
commit
184c2bc999
1 changed files with 2 additions and 2 deletions
|
|
@ -998,7 +998,7 @@ defmodule ToweropsWeb.AgentChannel do
|
|||
# Process processors
|
||||
case Base.discover_processors(client_opts) do
|
||||
{:ok, processors} when processors != [] ->
|
||||
discovered_device = %{device_id: device.id}
|
||||
discovered_device = %{id: device.snmp_device.id}
|
||||
Towerops.Snmp.Discovery.sync_processors(discovered_device, processors)
|
||||
|
||||
_ ->
|
||||
|
|
@ -1008,7 +1008,7 @@ defmodule ToweropsWeb.AgentChannel do
|
|||
# Process storage
|
||||
case Base.discover_storage(client_opts) do
|
||||
{:ok, storage} when storage != [] ->
|
||||
discovered_device = %{device_id: device.id}
|
||||
discovered_device = %{id: device.snmp_device.id}
|
||||
Towerops.Snmp.Discovery.sync_storage(discovered_device, storage)
|
||||
|
||||
_ ->
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue