Documentation
¶
Overview ¶
Package nagios provides common types and package-level variables for use with Nagios plugins.
OVERVIEW ¶
This package contains common types and package-level variables. The intent is to reduce code duplication between various plugins that we maintain.
PROJECT HOME ¶
See our GitHub repo (https://github.com/atc0005/go-nagios) for the latest code, to file an issue or submit improvements for review and potential inclusion into the project.
HOW TO USE ¶
Assuming that you're using Go Modules (https://blog.golang.org/using-go-modules), add this line to your imports like so:
package main import ( "fmt" "log" "os" "github.com/atc0005/go-nagios" )
Then in your code reference the data types as you would from any other package:
fmt.Println("OK: All checks have passed") os.Exit(nagios.StateOK)
When you next build your package this one should be pulled in.
Package nagios is a small collection of common types and package-level variables intended for use with various plugins to reduce code duplication.
Index ¶
Constants ¶
const ( StateOK int = 0 StateWARNING int = 1 StateCRITICAL int = 2 StateUNKNOWN int = 3 StateDEPENDENT int = 4 )
Nagios plugin/service check states. These constants replicate the values from utils.sh which is normally found at one of these two locations, depending on which Linux distribution you're using:
/usr/lib/nagios/plugins/utils.sh /usr/local/nagios/libexec/utils.sh
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
This section is empty.