checks

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	Name string
	// NOTE(motemen): We make use of config.PluginConfig as it happens
	// to have Command field which was used by metrics.pluginGenerator.
	// If the configuration of checks.Checker and metrics.pluginGenerator goes different ones,
	// we should reconcider using config.PluginConfig.
	Config config.PluginConfig
}

Checker is the main interface of check monitoring. It invokes its given command and transforms the result to a Report to be sent to Mackerel periodically.

func (Checker) Check

func (c Checker) Check() (*Report, error)

Check invokes the command and transforms its result to a Report.

func (Checker) Interval

func (c Checker) Interval() time.Duration

Interval is the interval where the command is invoked. (Will be configurable in the future)

func (Checker) String

func (c Checker) String() string

type Report

type Report struct {
	Name       string
	Status     Status
	Message    string
	OccurredAt time.Time
}

Report is what Checker produces by invoking its command.

type Status

type Status string

Status is a status that is produced by periodical checking. It is currently compatible with Nagios.

const (
	StatusUndefined Status = ""
	StatusOK        Status = "OK"
	StatusWarning   Status = "WARNING"
	StatusCritical  Status = "CRITICAL"
	StatusUnknown   Status = "UNKNOWN"
)

Current possible statuses, which is taken from command's exit code. the mapping is given as exitCodeToStatus.

Jump to

Keyboard shortcuts

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