SNMP v3 with incorrect auth password outputs bad data #7512
Labels
area/snmp
bug
unexpected problem or unintended behavior
error handling
Issues related to error handling
Relevant telegraf.conf:
System info:
Docker image
telegraf:1.14.2-alpine
The SNMP target I'm using is a Ubiquiti EdgeRouter 12. I haven't tested using any other SNMP target.
Docker
I'm using the
telegraf:1.14.2-alpine
docker image with the/etc/telegraf/telegraf.conf
file either copied into the container or bind-mounted. The environment variablesSNMP_AUTH_PASSWORD
andSNMP_PRIV_PASSWORD
are set when running the container, but the same behavior occurs if the password values are specified directly in the config file.Steps to reproduce:
authpriv
.agents
,sec_name
, andpriv_password
values so they would be valid when querying the SNMP v3 agent.auth_password
so it is incorrect for the SNMP agent being queriedExpected behavior:
The telegraf log indicates that the SNMP input plugin can't get any data due to an authentication problem.
Actual behavior:
Telegraf outputs incorrect data for source and uptime (or any other fields requested). Here is an example:
Additional info:
When specifying the correct
auth_password
I see data like this:I also noticed that
[[inputs.snmp.table]]
configurations don't cause any writes to the output when theauth_password
is incorrect.It is difficult to diagnose the problem as being related to authentication since there is no indication from telegraf that the authentication password is wrong. The incorrect data is being written to the output makes this even more confusing since it made me assume there was something wrong in another part of the configuration.
An invalid authentication password should be detectable since the
snmpwalk
command detects it. When the authentication password is incorrectsnmpwalk
returns the error:The text was updated successfully, but these errors were encountered: