Documentation ¶
Index ¶
Constants ¶
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 ¶
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.
type CheckBundleFunc ¶ added in v2.5.0
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
func (b CheckFuncBuilder) Build() CheckBundleFunc
Build returns a check function Run.Check
type CheckHostFunc ¶ added in v2.5.0
CheckHostFunc checks an individual host.
type Results ¶ added in v2.5.0
type Results []Result
func DefaultAggregate ¶
Default implementation of the Aggregate function.
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.