custom

package
v3.9.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package custom contains a custom collectd plugin monitor, for which you can specify your own config template and parameters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	config.MonitorConfig `yaml:",inline" acceptsEndpoints:"true"`

	// This should generally not be set manually, but will be filled in by the
	// agent if using service discovery. It can be accessed in the provided
	// config template with `{{.Host}}`.  It will be set to the hostname or IP
	// address of the discovered service. If you aren't using service
	// discovery, you can just hardcode the host/port in the config template
	// and ignore these fields.
	Host string `yaml:"host"`
	// This should generally not be set manually, but will be filled in by the
	// agent if using service discovery. It can be accessed in the provided
	// config template with `{{.Port}}`.  It will be set to the port of the
	// discovered service, if it is a TCP/UDP endpoint.
	Port uint16 `yaml:"port"`
	// This should generally not be set manually, but will be filled in by the
	// agent if using service discovery. It can be accessed in the provided
	// config template with `{{.Name}}`.  It will be set to the name that the
	// observer creates for the endpoint upon discovery.  You can generally
	// ignore this field.
	Name string `yaml:"name"`

	// A config template for collectd.  You can include as many plugin blocks
	// as you want in this value.  It is rendered as a standard Go template, so
	// be mindful of the delimiters `{{` and `}}`.
	Template string `yaml:"template"`
	// A list of templates, but otherwise equivalent to the above `template`
	// option.  This enables you to have a single directory with collectd
	// configuration files and load them all by using a globbed remote config
	// value:
	Templates []string `yaml:"templates"`

	// The number of read threads to use in collectd.  Will default to the
	// number of templates provided, capped at 10, but if you manually specify
	// it there is no limit.
	CollectdReadThreads int `yaml:"collectdReadThreads"`
}

Config is the configuration for the collectd custom monitor

func (*Config) Validate

func (c *Config) Validate() error

Validate will check the config that is specific to this monitor

type Monitor

type Monitor struct {
	collectd.MonitorCore
}

Monitor is the core monitor object that gets instantiated by the agent

func (*Monitor) Configure

func (cm *Monitor) Configure(conf *Config) error

Configure will render the custom collectd config and queue a collectd restart.

Jump to

Keyboard shortcuts

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