Documentation ¶
Overview ¶
Package results implements a helper that can be used to store the results of a Nagios, Centreon, Icinga... service monitoring plugin, and convert them to text which can be sent to the monitoring server.
Index ¶
- type Results
- func (p *Results) AddLine(line string)
- func (p *Results) AddLinef(format string, data ...interface{})
- func (p *Results) AddLines(lines []string)
- func (p *Results) AddPerfData(pd *perfdata.PerfData)
- func (p *Results) ExitCode() int
- func (p *Results) SetState(status status.Status, message string)
- func (p *Results) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Results ¶
type Results struct {
// contains filtered or unexported fields
}
Results represents the monitoring plugin's results, including its name, return status and message, additional lines of text, and performance data to be encoded in the output.
func New ¶
New creates the plugin with `name` as its name and an unknown status.
func (*Results) AddLine ¶
AddLine adds the specified string to the extra output text buffer.
func (*Results) AddLinef ¶
AddLinef formats the input and adds it to the text buffer.
func (*Results) AddLines ¶
AddLines add the specified `lines` to the output text.
func (*Results) AddPerfData ¶
AddPerfData adds performance data described by the "pd" argument to the output's performance data. If two performance data records are added for the same label, the program panics.
func (*Results) ExitCode ¶
ExitCode returns the plugin's exit code.
func (*Results) SetState ¶
SetState sets the plugin's output code to `status` and its message to the specified `message`.