exec

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2015 License: MIT Imports: 7 Imported by: 0

README

Exec Plugin

The exec plugin can execute arbitrary commands which return flattened JSON.

For example, if you have a json-returning command called mycollector, you could setup the exec plugin with:

[[exec.commands]]
command = "/usr/bin/mycollector --output=json"
name = "mycollector"

The name is used as a prefix for the measurements.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Command string
	Name    string
}

type CommandRunner

type CommandRunner struct {
}

func (CommandRunner) Run

func (c CommandRunner) Run(command string, args ...string) ([]byte, error)

type Exec

type Exec struct {
	Commands []*Command
	// contains filtered or unexported fields
}

func NewExec

func NewExec() *Exec

func (*Exec) Description

func (e *Exec) Description() string

func (*Exec) Gather

func (e *Exec) Gather(acc plugins.Accumulator) error

func (*Exec) SampleConfig

func (e *Exec) SampleConfig() string

type Runner

type Runner interface {
	Run(string, ...string) ([]byte, error)
}

Jump to

Keyboard shortcuts

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