zabbix_aggregate_agent

package
v0.0.0-...-87d3524 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2014 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout  = 60
	DefaultAddress  = "127.0.0.1:10052"
	Debug           = 0
	Info            = 1
	Error           = 2
	DefaultLogLevel = Info
)

Variables

View Source
var LogLabel = []string{"DEBUG", "INFO", "ERROR"}

Functions

func NewCachedListGenerator

func NewCachedListGenerator(generator func() ([]string, error), expires int) (cachedGenerator func() ([]string, error))

func NewListFromArgGenerator

func NewListFromArgGenerator(source string) (f func() ([]string, error))

func NewListFromCommandGenerator

func NewListFromCommandGenerator(command string, args ...string) (f func() ([]string, error))

func NewListFromFileGenerator

func NewListFromFileGenerator(filename string) (f func() ([]string, error))

func NewListGenerator

func NewListGenerator(list []string) (f func() ([]string, error))

func ReadConfig

func ReadConfig(filename string) (configAgents []agent, err error)

Types

type Agent

type Agent struct {
	Name          string
	Listen        string
	ListGenerator func() ([]string, error)
	Timeout       int
	LogPrefix     string
	MinLogLevel   int
}

func NewAgent

func NewAgent(name string, listen string, timeout int) (a *Agent)

func NewAgentsFromConfig

func NewAgentsFromConfig(filename string) (agentInstances []*Agent, err error)

func (*Agent) Log

func (a *Agent) Log(level int, params ...interface{})

func (*Agent) Run

func (a *Agent) Run() (err error)

func (*Agent) RunNotify

func (a *Agent) RunNotify(ch chan bool)

type Cache

type Cache struct {
	List      []string
	UpdatedAt time.Time
	Expires   time.Duration
	Generator func() ([]string, error)
}

Jump to

Keyboard shortcuts

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