Documentation ¶
Index ¶
Constants ¶
const ( // DefaultSuccessMessage the default message if the check was successful DefaultSuccessMessage string = "everything ok" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Range ¶
Range is a combination of a lower boundary, an upper boundary and a flag for inverted (@) range semantics. See [0] for more details.
type Result ¶
Result interface for service check results
func NewResultOk ¶
NewResultOk creates a new instance of Result and set result to ServiceStateOk
func NewResultOkMessage ¶
NewResultOkMessage creates a new instance of Result and set result to ServiceStateOk
func NewResultUnknownMessage ¶
NewResultUnknownMessage creates a new instance of Result and set result to ServiceStateOk
type Results ¶
type Results interface { All() []Result Add(Result) CalculateStatus() Status GenerateMessage() string Exit() }
Results contains multiple results for service checks
func NewResultsWithOptions ¶
func NewResultsWithOptions(options ResultsOptions) Results
NewResultsWithOptions creates a new instance of Results with options
type ResultsOptions ¶
type ResultsOptions struct { StatusPolicy StatusPolicy StatusMessagePolicy StatusMessagePolicy }
ResultsOptions options to generate a new instance of Results
type Status ¶
type Status int
Status defines the service status
type StatusCheck ¶
type StatusCheck interface { Check(float64) Status CheckInt(int) Status CheckInt32(int32) Status Compare(func() bool) Status CompareBool(value bool) Status }
StatusCheck contains the thresholds for warning and critical escalation
func NewStatusCheck ¶
func NewStatusCheck(warning string, critical string) (StatusCheck, error)
NewStatusCheck parse warning and critical thresholds into an StatusCheck object
func NewStatusCheckCompare ¶
func NewStatusCheckCompare(result string) (StatusCheck, error)
NewStatusCheckCompare returns a new StatusCheck to evaluate a status based on a closure and return a Status based on result
type StatusMessagePolicy ¶
StatusMessagePolicy interface for all status policies
func NewDefaultStatusMessagePolicy ¶
func NewDefaultStatusMessagePolicy() StatusMessagePolicy
NewDefaultStatusMessagePolicy returns a status policy that assigns relative severity in accordance with conventional Nagios plugin return codes. Statuses associated with higher return codes are more severe.
type StatusPolicy ¶
StatusPolicy interface for all status policies
func NewDefaultStatusPolicy ¶
func NewDefaultStatusPolicy() StatusPolicy
NewDefaultStatusPolicy returns a status policy that assigns relative severity in accordance with conventional Nagios plugin return codes. Statuses associated with higher return codes are more severe.