Documentation ¶
Index ¶
- Variables
- func Exit(state State, msg string)
- func ExitOnError(err error)
- func LongExit(state State, msg, longMsg string)
- func NewPerformanceData(label string, value float64) *performanceData
- func NewPerformanceDataString(label, value string) *performanceData
- func PrintPerformanceData() string
- func StartTimeout(duration time.Duration)
- type Evaluator
- type State
- type States
- type Threshold
Constants ¶
This section is empty.
Variables ¶
var ( //OK - returncode: 0 OK = State{/* contains filtered or unexported fields */} //Warning - returncode: 1 Warning = State{/* contains filtered or unexported fields */} //Critical - returncode: 2 Critical = State{/* contains filtered or unexported fields */} //Unknown - returncode: 3 Unknown = State{/* contains filtered or unexported fields */} )
var ErrEmptyStates = errors.New("The given States do not contain a State")
ErrEmptyStates will be thrown if no State was added to the States array
var ( //ErrFirstBiggerThenSecond this error is thrown when the first number is bigger then the second ErrFirstBiggerThenSecond = errors.New("First argument is bigger then second") )
Functions ¶
func ExitOnError ¶
func ExitOnError(err error)
ExitOnError quits with unknown and the error message if an error was passed
func LongExit ¶
LongExit returns with the given returncode and message and optional performancedata and long message
func NewPerformanceData ¶
NewPerformanceData adds a Performancedata object which can be expanded with further information
func NewPerformanceDataString ¶
func NewPerformanceDataString(label, value string) *performanceData
NewPerformanceDataString adds a Performancedata object which can be expanded with further information
func PrintPerformanceData ¶
func PrintPerformanceData() string
PrintPerformanceData prints all performancedata
func StartTimeout ¶
StartTimeout starts an timeout, which will end the program with an unknown code
Types ¶
type State ¶
type State struct {
// contains filtered or unexported fields
}
State represents an nagioskind returncode
func StateFromInt ¶
StateFromInt creates an known state if code is 0-3, else a new State will be returned
func StateFromString ¶
StateFromString creates an known state if string is "ok|warning|critical|unknown", else a new State will be returned
type States ¶
type States []State
States is a list of state
type Threshold ¶
type Threshold struct {
// contains filtered or unexported fields
}
Threshold contains the threshold logic: https://www.monitoring-plugins.org/doc/guidelines.html#THRESHOLDFORMAT
func NewThreshold ¶
NewThreshold constructs a new Threshold from string, returns an Threshold if possible else nil and an error