CheckWMI
Check status via WMI

CheckWMI — CheckWMI

Check status via WMI

Queries (Overview):

A list of all available queries (check commands)

Command Description
check_wmi Check a set of WMI values and return rows which are matching criteria.

Aliases (Overview):

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

Command Description
checkwmi Alias for: check_wmi

Commands (Overview):

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

Configuration (Overview):

Queries

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

check_wmi

CheckWMIcheck_wmi
Check a set of WMI values and return rows which are matching criteria.

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).
debug N/A Show debugging information in the log
show-all N/A Show debugging information in the log
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.
empty-state ignored Return status to use when nothing matched filter.
perf-config   Performance data generation configuration
top-syntax ${list} Top level syntax.
ok-syntax   ok syntax.
empty-syntax   Empty syntax.
detail-syntax %(line) Detail level syntax.
perf-syntax   Performance alias syntax.
target   The target to check (for checking remote machines).
user   Remote username when checking remote machines.
password   Remote password when checking remote machines.
namespace rootcimv2 The WMI root namespace to bind to.
query   The WMI query to execute.

Samples

Basic check to see/fetch information (no check):

check_wmi "query=Select Version,Caption from win32_OperatingSystem"
OK: Microsoft Windows 8.1 Pro, 6.3.9600

A simple string check:

check_wmi "query=Select Version,Caption from win32_OperatingSystem" "warn=Version not like '6.3'" "crit=Version not like '6'"
OK: Microsoft Windows 8.1 Pro, 6.3.9600

Simple check via via NRPE:

check_nrpe --host 192.168.56.103 --command check_wmi -a "query=Select Version,Caption from win32_OperatingSystem" "warn=Version not like '6.3'" "crit=Version not like '6'"
OK: Microsoft Windows 8.1 Pro, 6.3.9600

A simple integer (number) check:

check_wmi "query=Select BuildNumber from win32_OperatingSystem" "warn=BuildNumber < 9600" "crit=BuildNumber < 8000"
L        cli OK: 9600
L        cli  Performance data: 'BuildNumber'=9600;9600;8000

Using performance options to customize the performance data:

check_wmi "query=select Name, AvgDiskQueueLength from Win32_PerfFormattedData_PerfDisk_PhysicalDisk" "warn=AvgDiskQueueLength>0" "perf-syntax=%(Name)" "perf-config=*(prefix:'time')"
L        cli OK: 0, _Total, 0, 0 C:, 0, 1 D:
L        cli  Performance data: 'time_Total'=0;0;0 'time0 C:'=0;0;0 'time1 D:'=0;0;0

Adding values to the message:

check_wmi "query=Select BuildNumber from win32_OperatingSystem" "warn=BuildNumber < 9600" "crit=BuildNumber < 8000" "detail-syntax=You have build %(BuildNumber)" show-all
L        cli OK: You have build 10240
L        cli  Performance data: 'BuildNumber'=10240;9600;8000

Arguments

help (CheckWMI, check_wmi)
Show help screen (this screen)
help-pb (CheckWMI, check_wmi)
Show help screen as a protocol buffer payload
show-default (CheckWMI, check_wmi)
Show default values for a given command
help-short (CheckWMI, check_wmi)
Show help screen (short format).
debug (CheckWMI, check_wmi)
Show debugging information in the log
show-all (CheckWMI, check_wmi)
Show debugging information in the log
filter (CheckWMI, check_wmi)
Filter which marks interesting items.
Interesting items are items which will be included in the check.
They do not denote warning or critical state but they are checked use this to filter out unwanted items.
Available options:
Key Value
count Number of items matching the filter
total Total number of items
ok_count Number of items matched the ok criteria
warn_count Number of items matched the warning criteria
crit_count Number of items matched the critical criteria
problem_count Number of items matched either warning or critical criteria
list A list of all items which matched the filter
ok_list A list of all items which matched the ok criteria
warn_list A list of all items which matched the warning criteria
crit_list A list of all items which matched the critical criteria
problem_list A list of all items which matched either the critical or the warning criteria
detail_list A special list with critical, then warning and fainally ok
status The returned status (OK/WARN/CRIT/UNKNOWN)
warning (CheckWMI, check_wmi)
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
total Total number of items
ok_count Number of items matched the ok criteria
warn_count Number of items matched the warning criteria
crit_count Number of items matched the critical criteria
problem_count Number of items matched either warning or critical criteria
list A list of all items which matched the filter
ok_list A list of all items which matched the ok criteria
warn_list A list of all items which matched the warning criteria
crit_list A list of all items which matched the critical criteria
problem_list A list of all items which matched either the critical or the warning criteria
detail_list A special list with critical, then warning and fainally ok
status The returned status (OK/WARN/CRIT/UNKNOWN)
warn (CheckWMI, check_wmi)
Short alias for warning
critical (CheckWMI, check_wmi)
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
total Total number of items
ok_count Number of items matched the ok criteria
warn_count Number of items matched the warning criteria
crit_count Number of items matched the critical criteria
problem_count Number of items matched either warning or critical criteria
list A list of all items which matched the filter
ok_list A list of all items which matched the ok criteria
warn_list A list of all items which matched the warning criteria
crit_list A list of all items which matched the critical criteria
problem_list A list of all items which matched either the critical or the warning criteria
detail_list A special list with critical, then warning and fainally ok
status The returned status (OK/WARN/CRIT/UNKNOWN)
crit (CheckWMI, check_wmi)
Short alias for critical.
ok (CheckWMI, check_wmi)
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
total Total number of items
ok_count Number of items matched the ok criteria
warn_count Number of items matched the warning criteria
crit_count Number of items matched the critical criteria
problem_count Number of items matched either warning or critical criteria
list A list of all items which matched the filter
ok_list A list of all items which matched the ok criteria
warn_list A list of all items which matched the warning criteria
crit_list A list of all items which matched the critical criteria
problem_list A list of all items which matched either the critical or the warning criteria
detail_list A special list with critical, then warning and fainally ok
status The returned status (OK/WARN/CRIT/UNKNOWN)
empty-state (CheckWMI, check_wmi)
Return status to use when nothing matched filter.
If no filter is specified this will never happen unless the file is empty.
perf-config (CheckWMI, check_wmi)
Performance data generation configuration
TODO: obj ( key: value; key: value) obj (key:valuer;key:value)
top-syntax (CheckWMI, check_wmi)
Top level syntax.
Used to format the message to return can include strings as well as special keywords such as:
Key Value
${count} Number of items matching the filter
${total} Total number of items
${ok_count} Number of items matched the ok criteria
${warn_count} Number of items matched the warning criteria
${crit_count} Number of items matched the critical criteria
${problem_count} Number of items matched either warning or critical criteria
${list} A list of all items which matched the filter
${ok_list} A list of all items which matched the ok criteria
${warn_list} A list of all items which matched the warning criteria
${crit_list} A list of all items which matched the critical criteria
${problem_list} A list of all items which matched either the critical or the warning criteria
${detail_list} A special list with critical, then warning and fainally ok
${status} The returned status (OK/WARN/CRIT/UNKNOWN)
ok-syntax (CheckWMI, check_wmi)
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 (CheckWMI, check_wmi)
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
${total} Total number of items
${ok_count} Number of items matched the ok criteria
${warn_count} Number of items matched the warning criteria
${crit_count} Number of items matched the critical criteria
${problem_count} Number of items matched either warning or critical criteria
${list} A list of all items which matched the filter
${ok_list} A list of all items which matched the ok criteria
${warn_list} A list of all items which matched the warning criteria
${crit_list} A list of all items which matched the critical criteria
${problem_list} A list of all items which matched either the critical or the warning criteria
${detail_list} A special list with critical, then warning and fainally ok
${status} The returned status (OK/WARN/CRIT/UNKNOWN)
detail-syntax (CheckWMI, check_wmi)
Detail level syntax.
This is the syntax of each item in the list of top-syntax (see above).
Possible values are:
Key Value
${count} Number of items matching the filter
${total} Total number of items
${ok_count} Number of items matched the ok criteria
${warn_count} Number of items matched the warning criteria
${crit_count} Number of items matched the critical criteria
${problem_count} Number of items matched either warning or critical criteria
${list} A list of all items which matched the filter
${ok_list} A list of all items which matched the ok criteria
${warn_list} A list of all items which matched the warning criteria
${crit_list} A list of all items which matched the critical criteria
${problem_list} A list of all items which matched either the critical or the warning criteria
${detail_list} A special list with critical, then warning and fainally ok
${status} The returned status (OK/WARN/CRIT/UNKNOWN)
perf-syntax (CheckWMI, check_wmi)
Performance alias syntax.
This is the syntax for the base names of the performance data.
Possible values are:
Key Value
${count} Number of items matching the filter
${total} Total number of items
${ok_count} Number of items matched the ok criteria
${warn_count} Number of items matched the warning criteria
${crit_count} Number of items matched the critical criteria
${problem_count} Number of items matched either warning or critical criteria
${list} A list of all items which matched the filter
${ok_list} A list of all items which matched the ok criteria
${warn_list} A list of all items which matched the warning criteria
${crit_list} A list of all items which matched the critical criteria
${problem_list} A list of all items which matched either the critical or the warning criteria
${detail_list} A special list with critical, then warning and fainally ok
${status} The returned status (OK/WARN/CRIT/UNKNOWN)
target (CheckWMI, check_wmi)
The target to check (for checking remote machines).
user (CheckWMI, check_wmi)
Remote username when checking remote machines.
password (CheckWMI, check_wmi)
Remote password when checking remote machines.
namespace (CheckWMI, check_wmi)
The WMI root namespace to bind to.
query (CheckWMI, check_wmi)
The WMI query to execute.

/ settings/ targets

/settings/targets (CheckWMI)

TARGET LIST SECTION

A list of available remote target systems

Sample:

# TARGET LIST SECTION
# A list of available remote target systems
[/settings/targets]
comments powered by Disqus