Fix poller worker to use debug level for missing SNMP OIDs
The poller was re-logging SNMP errors from Client.get as warnings, even though the client now logs them at debug level. Updated the poller to also use debug level for expected errors like :no_such_object. This completes the fix to reduce SNMP logging noise for devices that don't support certain MIB objects.
This commit is contained in:
parent
20101201c6
commit
77b41e0b24
1 changed files with 14 additions and 1 deletions
|
|
@ -191,7 +191,20 @@ defmodule Towerops.Snmp.PollerWorker do
|
|||
})
|
||||
|
||||
{:error, reason} ->
|
||||
Logger.warning("Failed to poll sensor #{sensor.sensor_descr}: #{inspect(reason)}")
|
||||
# Only log warnings for actual communication errors, not missing OIDs
|
||||
case reason do
|
||||
:no_such_object ->
|
||||
Logger.debug("Sensor #{sensor.sensor_descr} OID not found on device")
|
||||
|
||||
:no_such_instance ->
|
||||
Logger.debug("Sensor #{sensor.sensor_descr} instance not found on device")
|
||||
|
||||
:end_of_mib_view ->
|
||||
Logger.debug("Sensor #{sensor.sensor_descr} end of MIB view")
|
||||
|
||||
_ ->
|
||||
Logger.warning("Failed to poll sensor #{sensor.sensor_descr}: #{inspect(reason)}")
|
||||
end
|
||||
|
||||
Snmp.create_sensor_reading(%{
|
||||
sensor_id: sensor.id,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue