SNMP input can produce metrics with empty metric name #8840
Labels
area/snmp
bug
unexpected problem or unintended behavior
error handling
Issues related to error handling
Steps to reproduce:
The snmp input can have a table with no oid or name but with fields. (see the plugin readme https://github.com/influxdata/telegraf/blob/ea4feb1a07edfea3243cc328f1994f63852e9f96/plugins/inputs/snmp/README.md#table) If the table name and the table oid are not set, the plugin produces metrics with no name.
Relevant telegraf.conf:
Here's an example snmp input that exhibits the problem.
For this example you need a snmp agent running on localhost that allows access to IF-MIB::ifXTable with the public community string. I used net-snmp.
If you uncomment either the name or the oid settings, the metric is named so metrics are output.
System info:
I tested with telegraf master on linux but this is not platform specific.
Expected behavior:
I didn't expect telegraf to try to produce a metric with no name. Once I understood this was happening I would have expected an error from the snmp input or the agent itself or the file output.
The snmp input should provide a specific error, like "error: SNMP table at telegraf.conf line 234 is not named. One or both of the oid and name settings must be set".
Actual behavior:
Telegraf doesn't produce any metrics
The text was updated successfully, but these errors were encountered: