collectd

package module
v0.0.0-...-07d5b78 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2014 License: MIT Imports: 8 Imported by: 0

README

A simple library implementing the collectd plain text protocol.

Installation

go get honnef.co/go/collectd

Documentation

See http://godoc.org/honnef.co/go/collectd for documentation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

func DialUnix

func DialUnix(name string) (*Conn, error)

DialUnix opens a unix socket and passes it to New.

func New

func New(rw io.ReadWriteCloser) *Conn

New creates a collectd connection. Usually you will want to use DialUnix instead.

func (*Conn) Close

func (c *Conn) Close() error

Close closes the underlying io.ReadWriteCloser. If using DialUnix, this must be called to properly close the socket. If using New, it is optional.

func (*Conn) Flush

func (c *Conn) Flush(timeout int, plugins []string, identifiers []string) error

Flush flushes cached data older than timeout seconds. Use -1 to specify no timeout. By specifying plugins and identifiers the flushing can be limited to those.

func (*Conn) GetValue

func (c *Conn) GetValue(name string) (map[string]float64, error)

GetValue returns the values for an identifier. The map maps names to values.

func (*Conn) ListValues

func (c *Conn) ListValues() (map[string]time.Time, error)

ListValues returns all values known to collectd. The map maps identifier to time of last update.

func (*Conn) PutNotif

func (c *Conn) PutNotif(opts map[string]string, message string) error

PutNotif submits a notification to collectd.

func (*Conn) PutValue

func (c *Conn) PutValue(name string, opts map[string]string, t *time.Time, values ...interface{}) error

PutValue submits values to collectd. Each value can be a number or the string "U" to mean undefined. If t is nil, collectd will determine the current timestamp. opts is a key=value map of options.

func (*Conn) SendCommand

func (c *Conn) SendCommand(command string) ([]string, error)

SendCommand sends an arbitrary command to collectd.

type Error

type Error struct {
	Err error
}

Error wraps errors that collectd returns or that occur while processing collectd's response.

func (Error) Error

func (e Error) Error() string

type IOError

type IOError struct {
	Err error
}

IOError wraps errors that happen while reading or writing. It often indicates an error that renders the connection useless.

func (IOError) Error

func (e IOError) Error() string

Jump to

Keyboard shortcuts

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