Documentation ¶
Index ¶
Constants ¶
View Source
const DEFAULT_COMMAND_TIMEOUT = 60 // nrpe.c
View Source
const DEFAULT_TIMEOUT = 60 * time.Second
View Source
const MAX_FILENAME_LENGTH = 256 // common.h
View Source
const MAX_INPUT_BUFFER = 2048 // common.h
View Source
const MAX_PLUGIN_OUTPUT_LENGTH = 4095
View Source
const NRPE_BAD_COMMAND = "Invalid command specified in config file '%s' - Line %d"
View Source
const NRPE_BAD_TIMEOUT = "Invalid command_timeout specified in config file '%s' - Line %d"
View Source
const NRPE_DIR_OPEN_ERR = "Could not open config directory '%s' for reading."
View Source
const NRPE_FILE_OPEN_ERR = "Unable to open config file '%s' for reading"
View Source
const NRPE_NO_VAL_ERR = "No variable value specified in config file '%s' - Line '%d'"
View Source
const NRPE_NO_VAR_ERR = "No variable name specified in config file '%s' - Line '%d'"
Variables ¶
This section is empty.
Functions ¶
func DefaultOutputIfBlank ¶
func DefaultOutputIfBlank(output string, status PluginStatus) string
Types ¶
type ExitStatusTreatment ¶
type Message ¶
type Message struct { Message string Severity PluginStatus Err error }
type NagiosConfig ¶
type NagiosConfig struct { RunAsUser string RunAsGroup string AllowArguments bool CommandPrefix string CommandTimeout time.Duration NonFatalErrors []error Commands map[string]string }
func NewNagiosConfig ¶
func NewNagiosConfig() *NagiosConfig
func ParseConfig ¶
func ParseConfig(filename string) (*NagiosConfig, error)
type PluginContext ¶
type PluginContext struct { NagiosConfig *NagiosConfig ExitStatusTreatment *ExitStatusTreatment Messages []Message }
func (*PluginContext) Add ¶
func (pc *PluginContext) Add(severity PluginStatus, message string)
type PluginResult ¶
type PluginResult struct { OriginalOutput string Output string Status PluginStatus }
func RunPlugin ¶
func RunPlugin(context *PluginContext, command string, args ...string) (PluginResult, error)
type PluginStatus ¶
type PluginStatus int
const ( OK PluginStatus = 0 WARNING PluginStatus = 1 CRITICAL PluginStatus = 2 UNKNOWN PluginStatus = 3 )
func ExitStatusToPluginStatus ¶
func ExitStatusToPluginStatus(exitStatus int, treatment *ExitStatusTreatment) PluginStatus
func (PluginStatus) Color ¶
func (pluginStatus PluginStatus) Color() ct.Color
func (PluginStatus) String ¶
func (pluginStatus PluginStatus) String() string
Click to show internal directories.
Click to hide internal directories.