2024-07-20 18:56:51 +02:00
|
|
|
// The status package contains the datatype that corresponds to monitoring
|
|
|
|
// plugin status values.
|
|
|
|
package status // import nocternity.net/gomonop/pkg/status
|
2024-07-20 10:01:05 +02:00
|
|
|
|
|
|
|
// Status represents the return status of the monitoring plugin. The
|
|
|
|
// corresponding integer value will be used as the program's exit code,
|
|
|
|
// to be interpreted by the monitoring system.
|
|
|
|
type Status int
|
|
|
|
|
|
|
|
// Plugin exit statuses.
|
|
|
|
const (
|
|
|
|
StatusOK Status = iota
|
|
|
|
StatusWarning
|
|
|
|
StatusCritical
|
|
|
|
StatusUnknown
|
|
|
|
)
|
|
|
|
|
|
|
|
// String representations of the plugin statuses.
|
|
|
|
func (s Status) String() string {
|
|
|
|
return [...]string{"OK", "WARNING", "ERROR", "UNKNOWN"}[s]
|
|
|
|
}
|