CheckHelpers
Various helper function to extend other checks.

CheckHelpers — CheckHelpers

Various helper function to extend other checks.

Queries (Overview):

A list of all available queries (check commands)

Command Description
check_always_critical Run another check and regardless of its return code return CRITICAL.
check_always_ok Run another check and regardless of its return code return OK.
check_always_warning Run another check and regardless of its return code return WARNING.
check_and_forward Run a check and forward the result as a passive check.
check_critical Just return CRITICAL (anything passed along will be used as a message).
check_multi Run more then one check and return the worst state.
check_negate Run a check and alter the return status codes according to arguments.
check_ok Just return OK (anything passed along will be used as a message).
check_timeout Run a check and timeout after a given amount of time if the check has not returned.
check_version Just return the NSClient++ version.
check_warning Just return WARNING (anything passed along will be used as a message).
filter_perf Run a check and filter performance data.
render_perf Run a check and render the performance data as output message.
xform_perf Run a check and transform the performance data in various (currently one) way.

Aliases (Overview):

A list of all short hand aliases for queries (check commands)

Command Description
checkalwayscritical Alias for: check_always_critical
checkalwaysok Alias for: check_always_ok
checkalwayswarning Alias for: check_always_warning
checkcritical Alias for: check_critical
checkmultiple Alias for: check_multi
checkok Alias for: check_ok
checkversion Alias for: check_version
checkwarning Alias for: check_warning
negate Alias for: check_negate
timeout Alias for: check_timeout

Commands (Overview):

TODO: Add a list of all external commands (this is not check commands)

Queries

A quick reference for all available queries (check commands) in the CheckHelpers module.

check_always_critical

CheckHelperscheck_always_critical
Run another check and regardless of its return code return CRITICAL.

Usage:

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).

Arguments

help (CheckHelpers, check_always_critical)
Show help screen (this screen)
help-pb (CheckHelpers, check_always_critical)
Show help screen as a protocol buffer payload
show-default (CheckHelpers, check_always_critical)
Show default values for a given command
help-short (CheckHelpers, check_always_critical)
Show help screen (short format).

check_always_ok

CheckHelperscheck_always_ok
Run another check and regardless of its return code return OK.

Usage:

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).

Arguments

help (CheckHelpers, check_always_ok)
Show help screen (this screen)
help-pb (CheckHelpers, check_always_ok)
Show help screen as a protocol buffer payload
show-default (CheckHelpers, check_always_ok)
Show default values for a given command
help-short (CheckHelpers, check_always_ok)
Show help screen (short format).

check_always_warning

CheckHelperscheck_always_warning
Run another check and regardless of its return code return WARNING.

Usage:

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).

Arguments

help (CheckHelpers, check_always_warning)
Show help screen (this screen)
help-pb (CheckHelpers, check_always_warning)
Show help screen as a protocol buffer payload
show-default (CheckHelpers, check_always_warning)
Show default values for a given command
help-short (CheckHelpers, check_always_warning)
Show help screen (short format).

check_and_forward

CheckHelperscheck_and_forward
Run a check and forward the result as a passive check.

Usage:

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).
target   Commands to run (can be used multiple times)
command   Commands to run (can be used multiple times)
arguments   List of arguments (for wrapped command)

Arguments

help (CheckHelpers, check_and_forward)
Show help screen (this screen)
help-pb (CheckHelpers, check_and_forward)
Show help screen as a protocol buffer payload
show-default (CheckHelpers, check_and_forward)
Show default values for a given command
help-short (CheckHelpers, check_and_forward)
Show help screen (short format).
target (CheckHelpers, check_and_forward)
Commands to run (can be used multiple times)
command (CheckHelpers, check_and_forward)
Commands to run (can be used multiple times)
arguments (CheckHelpers, check_and_forward)
List of arguments (for wrapped command)

check_critical

CheckHelperscheck_critical
Just return CRITICAL (anything passed along will be used as a message).

Usage:

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).
message No message Message to return

Arguments

help (CheckHelpers, check_critical)
Show help screen (this screen)
help-pb (CheckHelpers, check_critical)
Show help screen as a protocol buffer payload
show-default (CheckHelpers, check_critical)
Show default values for a given command
help-short (CheckHelpers, check_critical)
Show help screen (short format).
message (CheckHelpers, check_critical)
Message to return

check_multi

CheckHelperscheck_multi
Run more then one check and return the worst state.

Usage:

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).
command   Commands to run (can be used multiple times)
arguments   Deprecated alias for command
separator , Separator between messages
prefix   Message prefix
suffix   Message suffix

Arguments

help (CheckHelpers, check_multi)
Show help screen (this screen)
help-pb (CheckHelpers, check_multi)
Show help screen as a protocol buffer payload
show-default (CheckHelpers, check_multi)
Show default values for a given command
help-short (CheckHelpers, check_multi)
Show help screen (short format).
command (CheckHelpers, check_multi)
Commands to run (can be used multiple times)
arguments (CheckHelpers, check_multi)
Deprecated alias for command
separator (CheckHelpers, check_multi)
Separator between messages
prefix (CheckHelpers, check_multi)
Message prefix
suffix (CheckHelpers, check_multi)
Message suffix

check_negate

CheckHelperscheck_negate
Run a check and alter the return status codes according to arguments.

Usage:

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).
ok   The state to return instead of OK
warning   The state to return instead of WARNING
critical   The state to return instead of CRITICAL
unknown   The state to return instead of UNKNOWN
command   Wrapped command to execute
arguments   List of arguments (for wrapped command)

Arguments

help (CheckHelpers, check_negate)
Show help screen (this screen)
help-pb (CheckHelpers, check_negate)
Show help screen as a protocol buffer payload
show-default (CheckHelpers, check_negate)
Show default values for a given command
help-short (CheckHelpers, check_negate)
Show help screen (short format).
ok (CheckHelpers, check_negate)
The state to return instead of OK
warning (CheckHelpers, check_negate)
The state to return instead of WARNING
critical (CheckHelpers, check_negate)
The state to return instead of CRITICAL
unknown (CheckHelpers, check_negate)
The state to return instead of UNKNOWN
command (CheckHelpers, check_negate)
Wrapped command to execute
arguments (CheckHelpers, check_negate)
List of arguments (for wrapped command)

check_ok

CheckHelperscheck_ok
Just return OK (anything passed along will be used as a message).

Usage:

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).
message No message Message to return

Arguments

help (CheckHelpers, check_ok)
Show help screen (this screen)
help-pb (CheckHelpers, check_ok)
Show help screen as a protocol buffer payload
show-default (CheckHelpers, check_ok)
Show default values for a given command
help-short (CheckHelpers, check_ok)
Show help screen (short format).
message (CheckHelpers, check_ok)
Message to return

check_timeout

CheckHelperscheck_timeout
Run a check and timeout after a given amount of time if the check has not returned.

Usage:

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).
timeout   The timeout value
command   Wrapped command to execute
arguments   List of arguments (for wrapped command)
return   The return status

Arguments

help (CheckHelpers, check_timeout)
Show help screen (this screen)
help-pb (CheckHelpers, check_timeout)
Show help screen as a protocol buffer payload
show-default (CheckHelpers, check_timeout)
Show default values for a given command
help-short (CheckHelpers, check_timeout)
Show help screen (short format).
timeout (CheckHelpers, check_timeout)
The timeout value
command (CheckHelpers, check_timeout)
Wrapped command to execute
arguments (CheckHelpers, check_timeout)
List of arguments (for wrapped command)
return (CheckHelpers, check_timeout)
The return status

check_version

CheckHelperscheck_version
Just return the NSClient++ version.

Usage:

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).

Arguments

help (CheckHelpers, check_version)
Show help screen (this screen)
help-pb (CheckHelpers, check_version)
Show help screen as a protocol buffer payload
show-default (CheckHelpers, check_version)
Show default values for a given command
help-short (CheckHelpers, check_version)
Show help screen (short format).

check_warning

CheckHelperscheck_warning
Just return WARNING (anything passed along will be used as a message).

Usage:

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).
message No message Message to return

Arguments

help (CheckHelpers, check_warning)
Show help screen (this screen)
help-pb (CheckHelpers, check_warning)
Show help screen as a protocol buffer payload
show-default (CheckHelpers, check_warning)
Show default values for a given command
help-short (CheckHelpers, check_warning)
Show help screen (short format).
message (CheckHelpers, check_warning)
Message to return

filter_perf

CheckHelpersfilter_perf
Run a check and filter performance data.

Usage:

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).
sort none The sort order to use: none, normal or reversed
limit 0 The maximum number of items to return (0 returns all items)
command   Wrapped command to execute
arguments   List of arguments (for wrapped command)

Arguments

help (CheckHelpers, filter_perf)
Show help screen (this screen)
help-pb (CheckHelpers, filter_perf)
Show help screen as a protocol buffer payload
show-default (CheckHelpers, filter_perf)
Show default values for a given command
help-short (CheckHelpers, filter_perf)
Show help screen (short format).
sort (CheckHelpers, filter_perf)
The sort order to use: none, normal or reversed
limit (CheckHelpers, filter_perf)
The maximum number of items to return (0 returns all items)
command (CheckHelpers, filter_perf)
Wrapped command to execute
arguments (CheckHelpers, filter_perf)
List of arguments (for wrapped command)

render_perf

CheckHelpersrender_perf
Run a check and render the performance data as output message.

Usage:

:class: contentstable :delim: | :header: “Option”, “Default Value”, “Description”
filter | | Filter which marks interesting items.
warning | | Filter which marks items which generates a warning state.
warn | | Short alias for warning
critical | | Filter which marks items which generates a critical state.
crit | | Short alias for critical.
ok | | Filter which marks items which generates an ok state.
debug | N/A | Show debugging information in the log
show-all | N/A | Show details for all matches regardless of status (normally details are only showed for warnings and criticals).
empty-state | unknown | Return status to use when nothing matched filter.
perf-config | | Performance data generation configuration
escape-html | N/A | Escape any < and > characters to prevent HTML encoding
help | N/A | Show help screen (this screen)
help-pb | N/A | Show help screen as a protocol buffer payload
show-default | N/A | Show default values for a given command
help-short | N/A | Show help screen (short format).
top-syntax | %(status): %(message) %(list) | Top level syntax.
ok-syntax | | ok syntax.
empty-syntax | | Empty syntax.
detail-syntax | %(key) %(value) %(unit) %(warn) %(crit) %(min) %(max)
Detail level syntax.
perf-syntax | %(key) | Performance alias syntax.
command | | Wrapped command to execute
arguments | | List of arguments (for wrapped command)
remove-perf | N/A | List of arguments (for wrapped command)

Arguments

filter (CheckHelpers, render_perf)
Filter which marks interesting items.
Interesting items are items which will be included in the check.
They do not denote warning or critical state instead it defines which items are relevant and you can remove unwanted items.
Available options :
Key Value
count Number of items matching the filter. Common option for all checks.
total Total number of items. Common option for all checks.
ok_count Number of items matched the ok criteria. Common option for all checks.
warn_count Number of items matched the warning criteria. Common option for all checks.
crit_count Number of items matched the critical criteria. Common option for all checks.
problem_count Number of items matched either warning or critical criteria. Common option for all checks.
list A list of all items which matched the filter. Common option for all checks.
ok_list A list of all items which matched the ok criteria. Common option for all checks.
warn_list A list of all items which matched the warning criteria. Common option for all checks.
crit_list A list of all items which matched the critical criteria. Common option for all checks.
problem_list A list of all items which matched either the critical or the warning criteria. Common option for all checks.
detail_list A special list with critical, then warning and finally ok. Common option for all checks.
status The returned status (OK/WARN/CRIT/UNKNOWN). Common option for all checks.
crit Major version number
key Major version number
max Major version number
message Major version number
min Major version number
unit Major version number
value Major version number
warn Major version number
warning (CheckHelpers, render_perf)
Filter which marks items which generates a warning state.
If anything matches this filter the return status will be escalated to warning.
Available options :
Key Value
count Number of items matching the filter. Common option for all checks.
total Total number of items. Common option for all checks.
ok_count Number of items matched the ok criteria. Common option for all checks.
warn_count Number of items matched the warning criteria. Common option for all checks.
crit_count Number of items matched the critical criteria. Common option for all checks.
problem_count Number of items matched either warning or critical criteria. Common option for all checks.
list A list of all items which matched the filter. Common option for all checks.
ok_list A list of all items which matched the ok criteria. Common option for all checks.
warn_list A list of all items which matched the warning criteria. Common option for all checks.
crit_list A list of all items which matched the critical criteria. Common option for all checks.
problem_list A list of all items which matched either the critical or the warning criteria. Common option for all checks.
detail_list A special list with critical, then warning and finally ok. Common option for all checks.
status The returned status (OK/WARN/CRIT/UNKNOWN). Common option for all checks.
crit Major version number
key Major version number
max Major version number
message Major version number
min Major version number
unit Major version number
value Major version number
warn Major version number
warn (CheckHelpers, render_perf)
Short alias for warning
critical (CheckHelpers, render_perf)
Filter which marks items which generates a critical state.
If anything matches this filter the return status will be escalated to critical.
Available options :
Key Value
count Number of items matching the filter. Common option for all checks.
total Total number of items. Common option for all checks.
ok_count Number of items matched the ok criteria. Common option for all checks.
warn_count Number of items matched the warning criteria. Common option for all checks.
crit_count Number of items matched the critical criteria. Common option for all checks.
problem_count Number of items matched either warning or critical criteria. Common option for all checks.
list A list of all items which matched the filter. Common option for all checks.
ok_list A list of all items which matched the ok criteria. Common option for all checks.
warn_list A list of all items which matched the warning criteria. Common option for all checks.
crit_list A list of all items which matched the critical criteria. Common option for all checks.
problem_list A list of all items which matched either the critical or the warning criteria. Common option for all checks.
detail_list A special list with critical, then warning and finally ok. Common option for all checks.
status The returned status (OK/WARN/CRIT/UNKNOWN). Common option for all checks.
crit Major version number
key Major version number
max Major version number
message Major version number
min Major version number
unit Major version number
value Major version number
warn Major version number
crit (CheckHelpers, render_perf)
Short alias for critical.
ok (CheckHelpers, render_perf)
Filter which marks items which generates an ok state.
If anything matches this any previous state for this item will be reset to ok.
Available options :
Key Value
count Number of items matching the filter. Common option for all checks.
total Total number of items. Common option for all checks.
ok_count Number of items matched the ok criteria. Common option for all checks.
warn_count Number of items matched the warning criteria. Common option for all checks.
crit_count Number of items matched the critical criteria. Common option for all checks.
problem_count Number of items matched either warning or critical criteria. Common option for all checks.
list A list of all items which matched the filter. Common option for all checks.
ok_list A list of all items which matched the ok criteria. Common option for all checks.
warn_list A list of all items which matched the warning criteria. Common option for all checks.
crit_list A list of all items which matched the critical criteria. Common option for all checks.
problem_list A list of all items which matched either the critical or the warning criteria. Common option for all checks.
detail_list A special list with critical, then warning and finally ok. Common option for all checks.
status The returned status (OK/WARN/CRIT/UNKNOWN). Common option for all checks.
crit Major version number
key Major version number
max Major version number
message Major version number
min Major version number
unit Major version number
value Major version number
warn Major version number
debug (CheckHelpers, render_perf)
Show debugging information in the log
show-all (CheckHelpers, render_perf)
Show details for all matches regardless of status (normally details are only showed for warnings and criticals).
empty-state (CheckHelpers, render_perf)
Return status to use when nothing matched filter.
If no filter is specified this will never happen unless the file is empty.
perf-config (CheckHelpers, render_perf)
Performance data generation configuration
TODO: obj ( key: value; key: value) obj (key:valuer;key:value)
escape-html (CheckHelpers, render_perf)
Escape any < and > characters to prevent HTML encoding
help (CheckHelpers, render_perf)
Show help screen (this screen)
help-pb (CheckHelpers, render_perf)
Show help screen as a protocol buffer payload
show-default (CheckHelpers, render_perf)
Show default values for a given command
help-short (CheckHelpers, render_perf)
Show help screen (short format).
top-syntax (CheckHelpers, render_perf)
Top level syntax.
Used to format the message to return can include text as well as special keywords which will include information from the checks.
To add a keyword to the message you can use two syntaxes either ${keyword} or %(keyword) (there is no difference between them apart from ${} can be difficult to excpae on linux).
The available keywords are:
Key Value
count Number of items matching the filter. Common option for all checks.
total Total number of items. Common option for all checks.
ok_count Number of items matched the ok criteria. Common option for all checks.
warn_count Number of items matched the warning criteria. Common option for all checks.
crit_count Number of items matched the critical criteria. Common option for all checks.
problem_count Number of items matched either warning or critical criteria. Common option for all checks.
list A list of all items which matched the filter. Common option for all checks.
ok_list A list of all items which matched the ok criteria. Common option for all checks.
warn_list A list of all items which matched the warning criteria. Common option for all checks.
crit_list A list of all items which matched the critical criteria. Common option for all checks.
problem_list A list of all items which matched either the critical or the warning criteria. Common option for all checks.
detail_list A special list with critical, then warning and finally ok. Common option for all checks.
status The returned status (OK/WARN/CRIT/UNKNOWN). Common option for all checks.
ok-syntax (CheckHelpers, render_perf)
ok syntax.
DEPRECATED! This is the syntax for when an ok result is returned.
This value will not be used if your syntax contains %(list) or %(count).
empty-syntax (CheckHelpers, render_perf)
Empty syntax.
DEPRECATED! This is the syntax for when nothing matches the filter.
Possible values are:
Key Value
count Number of items matching the filter. Common option for all checks.
total Total number of items. Common option for all checks.
ok_count Number of items matched the ok criteria. Common option for all checks.
warn_count Number of items matched the warning criteria. Common option for all checks.
crit_count Number of items matched the critical criteria. Common option for all checks.
problem_count Number of items matched either warning or critical criteria. Common option for all checks.
list A list of all items which matched the filter. Common option for all checks.
ok_list A list of all items which matched the ok criteria. Common option for all checks.
warn_list A list of all items which matched the warning criteria. Common option for all checks.
crit_list A list of all items which matched the critical criteria. Common option for all checks.
problem_list A list of all items which matched either the critical or the warning criteria. Common option for all checks.
detail_list A special list with critical, then warning and finally ok. Common option for all checks.
status The returned status (OK/WARN/CRIT/UNKNOWN). Common option for all checks.
detail-syntax (CheckHelpers, render_perf)
Detail level syntax.
Used to format each resulting item in the message.
%(list) will be replaced with all the items formated by this syntax string in the top-syntax.
To add a keyword to the message you can use two syntaxes either ${keyword} or %(keyword) (there is no difference between them apart from ${} can be difficult to excpae on linux).
The available keywords are:
Key Value
crit Major version number
key Major version number
max Major version number
message Major version number
min Major version number
unit Major version number
value Major version number
warn Major version number
perf-syntax (CheckHelpers, render_perf)
Performance alias syntax.
This is the syntax for the base names of the performance data.
Possible values are:
Key Value
crit Major version number
key Major version number
max Major version number
message Major version number
min Major version number
unit Major version number
value Major version number
warn Major version number
command (CheckHelpers, render_perf)
Wrapped command to execute
arguments (CheckHelpers, render_perf)
List of arguments (for wrapped command)
remove-perf (CheckHelpers, render_perf)
List of arguments (for wrapped command)

xform_perf

CheckHelpersxform_perf
Run a check and transform the performance data in various (currently one) way.

Usage:

Option Default Value Description
help N/A Show help screen (this screen)
help-pb N/A Show help screen as a protocol buffer payload
show-default N/A Show default values for a given command
help-short N/A Show help screen (short format).
command   Wrapped command to execute
arguments   List of arguments (for wrapped command)
mode   Transformation mode (currently only supports extract)
field   Field to work with (value, warn, crit, max, min)
replace   Replace expression for the alias

Arguments

help (CheckHelpers, xform_perf)
Show help screen (this screen)
help-pb (CheckHelpers, xform_perf)
Show help screen as a protocol buffer payload
show-default (CheckHelpers, xform_perf)
Show default values for a given command
help-short (CheckHelpers, xform_perf)
Show help screen (short format).
command (CheckHelpers, xform_perf)
Wrapped command to execute
arguments (CheckHelpers, xform_perf)
List of arguments (for wrapped command)
mode (CheckHelpers, xform_perf)
Transformation mode (currently only supports extract)
field (CheckHelpers, xform_perf)
Field to work with (value, warn, crit, max, min)
replace (CheckHelpers, xform_perf)
Replace expression for the alias
comments powered by Disqus