checks

package
v2.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SUndefined means that the check wasn't performed successfully.
	SUndefined Status = "UNDEFINED"
	// SOK means that the bundle passed the check.
	SOK = "OK"
	// SProblem means that the bundle failed to pass the check.
	SProblem = "PROBLEM"
)

Variables

This section is empty.

Functions

func RegisterCheck

func RegisterCheck(c Check)

RegisterCheck registers a new check to make it discoverable for consumers.

func RegisterSearchChecks

func RegisterSearchChecks()

Types

type Aggregate

type Aggregate func(results Results) Results

Aggregate aggregates check results produced by CheckMaster, CheckAgents, and CheckPublicAgents functions.

type Check

type Check struct {
	Name           string          `yaml:"name"`           // Required
	Description    string          `yaml:"description"`    // Required
	Cure           string          `yaml:"cure"`           // Required
	OKSummary      string          `yaml:"okSummary"`      // Optional
	ProblemSummary string          `yaml:"problemSummary"` // Optional
	Run            CheckBundleFunc // Required
}

Check checks some aspect of the DC/OS cluster analyzing its diagnostics bundle. Checks can be registered in the check registry with the registerCheck function.

func Checks

func Checks() []Check

Checks Returns all registered checks.

func GetCheck

func GetCheck(name string) Check

GetCheck returns check by name.

type CheckBundleFunc added in v2.5.0

type CheckBundleFunc func(bundle.Bundle) Results

type CheckFuncBuilder added in v2.5.0

type CheckFuncBuilder struct {
	CheckMasters      CheckHostFunc // At least one of
	CheckAgents       CheckHostFunc // the Collect... functions
	CheckPublicAgents CheckHostFunc // are required
	Aggregate         Aggregate     // Implement if the default is not sufficient
}

CheckFuncBuilder helps to create map/reduce-like checks.

func (CheckFuncBuilder) Build added in v2.5.0

Build returns a check function Run.Check

type CheckHostFunc added in v2.5.0

type CheckHostFunc func(bundle.Host) Result

CheckHostFunc checks an individual host.

type Result

type Result struct {
	Status Status
	Value  interface{}
	Host   bundle.Host
}

Result represents check result.

func (Result) IsHostSet added in v2.5.0

func (r Result) IsHostSet() bool

type Results added in v2.5.0

type Results []Result

func DefaultAggregate

func DefaultAggregate(results Results) Results

Default implementation of the Aggregate function.

func (Results) OKs added in v2.5.0

func (r Results) OKs() Results

func (Results) Problems added in v2.5.0

func (r Results) Problems() Results

func (Results) Status added in v2.5.0

func (r Results) Status() Status

func (Results) Undefined added in v2.5.0

func (r Results) Undefined() Results

type SearchCheck added in v2.5.0

type SearchCheck struct {
	Check                `yaml:",inline"`
	FileTypeName         bundle.FileTypeName `yaml:"fileTypeName"`         // Required
	ErrorPattern         string              `yaml:"errorPattern"`         // Required
	CurePattern          string              `yaml:"curePattern"`          // Optional
	IsErrorPatternRegexp bool                `yaml:"isErrorPatternRegexp"` // Optional, default is false
	IsCurePatternRegexp  bool                `yaml:"isCurePatternRegexp"`  // Optional, default is false
	Max                  int                 `yaml:"max"`                  // Optional, default is 0
	FailIfNotFound       bool                `yaml:"failIfNotFound"`       // Optional, default false
	// contains filtered or unexported fields
}

SearchCheck is a check which searches for the specified string in the the specified files. If the pattern is found more than Max times, the check is considered problematic.

type Status

type Status string

Status defines possible check outcomes.

Jump to

Keyboard shortcuts

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