ifname

package
v1.23.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2022 License: MIT Imports: 14 Imported by: 1

README

Network Interface Name Processor Plugin

The ifname plugin looks up network interface names using SNMP.

Telegraf minimum version: Telegraf 1.15.0

Configuration

# Add a tag of the network interface name looked up over SNMP by interface number
[[processors.ifname]]
  ## Name of tag holding the interface number
  # tag = "ifIndex"

  ## Name of output tag where service name will be added
  # dest = "ifName"

  ## Name of tag of the SNMP agent to request the interface name from
  # agent = "agent"

  ## Timeout for each request.
  # timeout = "5s"

  ## SNMP version; can be 1, 2, or 3.
  # version = 2

  ## SNMP community string.
  # community = "public"

  ## Number of retries to attempt.
  # retries = 3

  ## The GETBULK max-repetitions parameter.
  # max_repetitions = 10

  ## SNMPv3 authentication and encryption options.
  ##
  ## Security Name.
  # sec_name = "myuser"
  ## Authentication protocol; one of "MD5", "SHA", or "".
  # auth_protocol = "MD5"
  ## Authentication password.
  # auth_password = "pass"
  ## Security Level; one of "noAuthNoPriv", "authNoPriv", or "authPriv".
  # sec_level = "authNoPriv"
  ## Context Name.
  # context_name = ""
  ## Privacy protocol used for encrypted messages; one of "DES", "AES" or "".
  # priv_protocol = ""
  ## Privacy password used for encrypted messages.
  # priv_password = ""

  ## max_parallel_lookups is the maximum number of SNMP requests to
  ## make at the same time.
  # max_parallel_lookups = 100

  ## ordered controls whether or not the metrics need to stay in the
  ## same order this plugin received them in. If false, this plugin
  ## may change the order when data is cached.  If you need metrics to
  ## stay in order set this to true.  keeping the metrics ordered may
  ## be slightly slower
  # ordered = false

  ## cache_ttl is the amount of time interface names are cached for a
  ## given agent.  After this period elapses if names are needed they
  ## will be retrieved again.
  # cache_ttl = "8h"

Example

Example config:

[[processors.ifname]]
  tag = "ifIndex"
  dest = "ifName"
- foo,ifIndex=2,agent=127.0.0.1 field=123 1502489900000000000
+ foo,ifIndex=2,agent=127.0.0.1,ifName=eth0 field=123 1502489900000000000

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IfName

type IfName struct {
	SourceTag string `toml:"tag"`
	DestTag   string `toml:"dest"`
	AgentTag  string `toml:"agent"`

	snmp.ClientConfig

	CacheSize          uint            `toml:"max_cache_entries"`
	MaxParallelLookups int             `toml:"max_parallel_lookups"`
	Ordered            bool            `toml:"ordered"`
	CacheTTL           config.Duration `toml:"cache_ttl"`

	Log telegraf.Logger `toml:"-"`
	// contains filtered or unexported fields
}

func (*IfName) Add

func (d *IfName) Add(metric telegraf.Metric, _ telegraf.Accumulator) error

func (*IfName) Init

func (d *IfName) Init() error

func (*IfName) SampleConfig

func (*IfName) SampleConfig() string

func (*IfName) Start

func (d *IfName) Start(acc telegraf.Accumulator) error

func (*IfName) Stop

func (d *IfName) Stop() error

type LRUCache

type LRUCache struct {
	// contains filtered or unexported fields
}

func NewLRUCache

func NewLRUCache(capacity uint) LRUCache

initializes a new LRUCache.

func (*LRUCache) Delete

func (c *LRUCache) Delete(key keyType)

func (*LRUCache) Get

func (c *LRUCache) Get(key keyType) (LRUValType, bool)

Get a list node from the hash map.

func (*LRUCache) Put

func (c *LRUCache) Put(key keyType, value LRUValType)

Put key and value in the LRUCache

type LRUValType

type LRUValType = TTLValType

type Pair

type Pair struct {
	// contains filtered or unexported fields
}

Pair is the value of a list node.

type TTLCache

type TTLCache struct {
	// contains filtered or unexported fields
}

func NewTTLCache

func NewTTLCache(valid time.Duration, capacity uint) TTLCache

func (*TTLCache) Delete

func (c *TTLCache) Delete(key keyType)

func (*TTLCache) Get

func (c *TTLCache) Get(key keyType) (valType, bool, time.Duration)

func (*TTLCache) Put

func (c *TTLCache) Put(key keyType, value valType)

type TTLValType

type TTLValType struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL