diff --git a/lib/towerops_web/channels/agent_channel.ex b/lib/towerops_web/channels/agent_channel.ex index b16c499a..80bd58cb 100644 --- a/lib/towerops_web/channels/agent_channel.ex +++ b/lib/towerops_web/channels/agent_channel.ex @@ -245,10 +245,10 @@ defmodule ToweropsWeb.AgentChannel do end defp build_polling_queries(device) do - sensor_oids = Enum.map(device.sensors, & &1.sensor_oid) + sensor_oids = Enum.map(device.snmp_device.sensors, & &1.sensor_oid) interface_oids = - Enum.flat_map(device.interfaces, fn iface -> + Enum.flat_map(device.snmp_device.interfaces, fn iface -> idx = iface.if_index [ @@ -351,7 +351,7 @@ defmodule ToweropsWeb.AgentChannel do end) # Process interface stats - Enum.each(device.interfaces, fn iface -> + Enum.each(device.snmp_device.interfaces, fn iface -> idx = iface.if_index Snmp.create_interface_stat(%{