messages

package
v2.0.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Based on https://github.com/newrelic/go_nagios

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Critical

func Critical(err error)

Exit with an CRITICAL status and appropriate message

func ExitWithStatus

func ExitWithStatus(status *NagiosStatus)

Exit with a particular NagiosStatus

func Ok

func Ok(output string)

Exit with an OK status and appropriate message

func Unknown

func Unknown(output string)

Exit with an UNKNOWN status and appropriate message

func Warning

func Warning(output string)

Exit with an WARNING status and appropriate message

Types

type NagiosStatus

type NagiosStatus struct {
	Message string
	Value   NagiosStatusVal
}

func (*NagiosStatus) Aggregate

func (status *NagiosStatus) Aggregate(otherStatuses []*NagiosStatus)

Take a bunch of NagiosStatus pointers and find the highest value, then combine all the messages. Things win in the order of highest to lowest.

type NagiosStatusVal

type NagiosStatusVal int
const (
	NAGIOS_OK NagiosStatusVal = iota
	NAGIOS_WARNING
	NAGIOS_CRITICAL
	NAGIOS_UNKNOWN
)

Jump to

Keyboard shortcuts

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