nagios

package
v1.24.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: MIT Imports: 12 Imported by: 22

README

Nagios Parser Plugin

The nagios data format parses the output of nagios plugins.

Configuration

[[inputs.exec]]
  ## Commands array
  commands = ["/usr/lib/nagios/plugins/check_load -w 5,6,7 -c 7,8,9"]

  ## 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 = "nagios"

Documentation

Index

Constants

View Source
const (
	MaxFloat64 = 1.797693134862315708145274237317043567981e+308 // 2**1023 * (2**53 - 1) / 2**52
	MinFloat64 = 4.940656458412465441765687928682213723651e-324 // 1 / 2**(1023 - 1 + 52)
)

from math

Variables

View Source
var ErrBadThresholdFormat = errors.New("bad threshold format")

Functions

func AddState added in v1.23.0

func AddState(runErr error, errMessage []byte, metrics []telegraf.Metric) []telegraf.Metric

AddState adds a state derived from the runErr. Unknown state will be set as fallback. If any error occurs, it is guaranteed to be added to the service output. An updated slice of metrics will be returned.

Types

type Parser added in v1.24.0

type Parser struct {
	DefaultTags map[string]string `toml:"-"`
	Log         telegraf.Logger   `toml:"-"`
	// contains filtered or unexported fields
}

func (*Parser) InitFromConfig added in v1.24.0

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

InitFromConfig is a compatibility function to construct the parser the old way

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