10. Value Types

In addition to configuration objects Icinga 2 also uses a few other types to represent its internal state. The following types are exposed via the API.

10.1. CheckResult

Name Type Description
exit_status  Number The exit status returned by the check execution.
output String The check output.
performance_data Array Array of performance data values.
check_source String Name of the node executing the check.
state Number The current state (0 = OK, 1 = WARNING, 2 = CRITICAL, 3 = UNKNOWN).
command Value Array of command with shell-escaped arguments or command line string.
execution_start Number Check execution start time (as a UNIX timestamp).
execution_end Number Check execution end time (as a UNIX timestamp).
schedule_start Number Scheduled check execution start time (as a UNIX timestamp).
schedule_end Number Scheduled check execution end time (as a UNIX timestamp).
active Boolean Whether the result is from an active or passive check.
vars_before Dictionary Internal attribute used for calculations.
vars_after Dictionary Internal attribute used for calculations.

10.2. PerfdataValue

Icinga 2 parses performance data strings returned by check plugins and makes the information available to external interfaces (e.g. GraphiteWriter or the Icinga 2 API.

Name Type Description
label  String Performance data label.
value Number Normalized performance data value without unit.
counter Boolean Enabled if the original value contains c as unit. Defaults to false.
unit String Unit of measurement (seconds, bytes. percent) according to the plugin API.
crit Value Critical threshold value.
warn Value Warning threshold value.
min Value Minimum value returned by the check.
max Value Maximum value returned by the check.