Hello, I’m successfully using the telegraf SNMP plugin to monitor networking devices. In some cases, the interfaces also have a description in addition to the name (for example eth0, gi8, etc.). So I’m trying to get a value like: “eth0 test interface”. Does anyone know if this is achievable? and maybe a piece of code for inspiration?
[[inputs.snmp.table.field]]
oid = "IF-MIB::ifName"
name = "ifName"
is_tag = true
[[inputs.snmp.table.field]]
oid = "IF-MIB::ifAlias"
name = "ifAlias"
[[inputs.snmp.table.field]]
oid = "IF-MIB::ifHCInOctets"
name = "input"
[[inputs.snmp.table.field]]
oid = "IF-MIB::ifHCOutOctets"
name = "output"
Processors, you are probably looking for merge:
# Merge Aggregator Plugin
Merge metrics together into a metric with multiple fields into the most memory
and network transfer efficient form.
Use this plugin when fields are split over multiple metrics, with the same
measurement, tag set and timestamp. By merging into a single metric they can
be handled more efficiently by the output.
## Global configuration options <!-- @/docs/includes/plugin_config.md -->
In addition to the plugin-specific configuration settings, plugins support
additional global and plugin configuration settings. These settings are used to
modify metrics, tags, and field or create aliases and configure ordering, etc.
See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
[CONFIGURATION.md]: ../../../docs/CONFIGURATION.md#plugins
## Configuration
This file has been truncated. show original
Thanks for your answer, browsing through the processors I found the plugin template
that seem to be right for me:
# Template Processor Plugin
The `template` processor applies a Go template to metrics to generate a new
tag. The primary use case of this plugin is to create a tag that can be used
for dynamic routing to multiple output plugins or using an output specific
routing option.
The template has access to each metric's measurement name, tags, fields, and
timestamp using the [interface in `/template_metric.go`](template_metric.go).
Read the full [Go Template Documentation][].
## Global configuration options <!-- @/docs/includes/plugin_config.md -->
In addition to the plugin-specific configuration settings, plugins support
additional global and plugin configuration settings. These settings are used to
modify metrics, tags, and field or create aliases and configure ordering, etc.
See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
[CONFIGURATION.md]: ../../../docs/CONFIGURATION.md#plugins
This file has been truncated. show original