collectd

package
v1.24.3 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: MIT Imports: 8 Imported by: 14

README

Collectd Parser Plugin

The collectd format parses the collectd binary network protocol. Tags are created for host, instance, type, and type instance. All collectd values are added as float64 fields.

For more information about the binary network protocol see here.

You can control the cryptographic settings with parser options. Create an authentication file and set collectd_auth_file to the path of the file, then set the desired security level in collectd_security_level.

Additional information including client setup can be found here.

You can also change the path to the typesdb or add additional typesdb using collectd_typesdb.

Configuration

[[inputs.socket_listener]]
  service_address = "udp://:25826"

  ## Data format to consume.
  ## Each data format has its own unique set of configuration options, read
  ## more about them here:
  ##   https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
  data_format = "collectd"

  ## Authentication file for cryptographic security levels
  collectd_auth_file = "/etc/collectd/auth_file"
  ## One of none (default), sign, or encrypt
  collectd_security_level = "encrypt"
  ## Path of to TypesDB specifications
  collectd_typesdb = ["/usr/share/collectd/types.db"]

  ## Multi-value plugins can be handled two ways.
  ## "split" will parse and store the multi-value plugin data into separate measurements
  ## "join" will parse and store the multi-value plugin as a single multi-value measurement.
  ## "split" is the default behavior for backward compatibility with previous versions of influxdb.
  collectd_parse_multivalue = "split"

Example Output

memory,type=memory,type_instance=buffered value=2520051712 1560455990829955922
memory,type=memory,type_instance=used value=3710791680 1560455990829955922
memory,type=memory,type_instance=buffered value=2520047616 1560455980830417318
memory,type=memory,type_instance=cached value=9472626688 1560455980830417318
memory,type=memory,type_instance=slab_recl value=2088894464 1560455980830417318
memory,type=memory,type_instance=slab_unrecl value=146984960 1560455980830417318
memory,type=memory,type_instance=free value=2978258944 1560455980830417318
memory,type=memory,type_instance=used value=3707047936 1560455980830417318

Documentation

Index

Constants

View Source
const (
	DefaultAuthFile = "/etc/collectd/auth_file"
)

Variables

This section is empty.

Functions

func LoadTypesDB

func LoadTypesDB(path string) (*api.TypesDB, error)

Types

type Parser added in v1.24.0

type Parser struct {
	DefaultTags map[string]string `toml:"-"`

	//whether or not to split multi value metric into multiple metrics
	//default value is split
	ParseMultiValue string `toml:"collectd_parse_multivalue"`

	AuthFile      string   `toml:"collectd_auth_file"`
	SecurityLevel string   `toml:"collectd_security_level"`
	TypesDB       []string `toml:"collectd_typesdb"`

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

func (*Parser) Init added in v1.24.0

func (p *Parser) Init() error

func (*Parser) InitFromConfig added in v1.24.0

func (p *Parser) InitFromConfig(config *parsers.Config) error

func (*Parser) Parse added in v1.24.0

func (p *Parser) Parse(buf []byte) ([]telegraf.Metric, error)

func (*Parser) ParseLine added in v1.24.0

func (p *Parser) ParseLine(line string) (telegraf.Metric, error)

func (*Parser) SetDefaultTags added in v1.24.0

func (p *Parser) SetDefaultTags(tags map[string]string)

Jump to

Keyboard shortcuts

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