checks

package
v0.81.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 4 Imported by: 27

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
	Config *config.CheckPlugin
}

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

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.

func (*Checker) String

func (c *Checker) String() string

type Report

type Report struct {
	Name                 string
	Status               Status
	Message              string
	OccurredAt           time.Time
	NotificationInterval *int32
	MaxCheckAttempts     *int32
	CustomIdentfier      *string
}

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