monitor

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PerfData

type PerfData []*PerfDataItem

func (PerfData) String

func (p PerfData) String() string

type PerfDataItem

type PerfDataItem struct {
	Help  string  `json:"-"`
	Name  string  `json:"name"`
	Value float64 `json:"value"`
	Warn  float64 `json:"warning"`
	Crit  float64 `json:"critical"`
	Unit  string  `json:"unit,omitempty"`
}

func (*PerfDataItem) String

func (i *PerfDataItem) String() string

type RenderFormat

type RenderFormat int
const (
	NagiosFormat RenderFormat = iota
	PrometheusFormat
	TextFormat
	JSONFormat
)

type Result

type Result struct {
	Output       string       `json:"output,omitempty"`
	Status       Status       `json:"status"`
	Check        string       `json:"check_suite"`
	Name         string       `json:"check_name"`
	Warnings     []string     `json:"warning,omitempty"`
	Criticals    []string     `json:"critical,omitempty"`
	OKs          []string     `json:"ok,omitempty"`
	PerfData     PerfData     `json:"perf_data"`
	RenderFormat RenderFormat `json:"-"`
	NameSpace    string       `json:"-"`
	OutFile      string       `json:"-"`
}

func (*Result) Critical

func (r *Result) Critical(format string, a ...any)

func (*Result) CriticalExit

func (r *Result) CriticalExit(format string, a ...any)

func (*Result) CriticalIfErr

func (r *Result) CriticalIfErr(err error, format string, a ...any) bool

func (*Result) Exit

func (r *Result) Exit()

func (*Result) GenericExit

func (r *Result) GenericExit()

func (*Result) Ok

func (r *Result) Ok(format string, a ...any)

func (*Result) Pd

func (r *Result) Pd(pd ...*PerfDataItem)

func (*Result) String

func (r *Result) String() string

func (*Result) Warn

func (r *Result) Warn(format string, a ...any)

type Status

type Status string
var (
	OKStatus       Status = "OK"
	WarningStatus  Status = "WARNING"
	CriticalStatus Status = "CRITICAL"
	UnknownStatus  Status = "UNKNOWN"
)

Jump to

Keyboard shortcuts

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