Skip to content

SNMP input - force IPv4/IPv6 #7879

@jacobreid

Description

@jacobreid

Feature Request

Opening a feature request kicks off a discussion.

Proposal:

Add an option for the SNMP input to be configured to use/prefer IPv4 or v6

Current behavior:

(telegraf 1.14.5) SNMP input seems to prefer IPv6 over IPv4 where there are both A and AAAA records for a hostname, and will not fall back to IPv4 if attempting to gather data via IPv6 fails.

Desired behavior:

Something in the config like ipv6 = [true, false, auto] where true uses ipv6 only if available (ignoring ipv4 if existing), false uses ipv4 only, and auto will try one and then the other if it fails (and ideally, remember which one worked for next run?) - in particular, trying IPv4 if an AAAA record is found but an attempt to gather data from the IPv6 address fails. True would be backwards compatible with current behaviour (fall back to IPv4 if no AAAA record, use only IPv6 and don't try v4 if there is an AAAA record) so probably the default setting.

Use case:

I have some network equipment with both A and AAAA records for its hostname that has a bug where SNMP only works over IPv4 but telegraf only attempts to reach it over IPv6.

It can be worked around by either pointing the SNMP input to the IPv4 address, or creating another hostname with only an A record, but it would be nice to use the canonical hostname instead.

Metadata

Metadata

Assignees

Labels

area/snmpfeature requestRequests for new plugin and for new features to existing plugins

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions