Command reference

A command template contains one or more commands, each with a set of rules that evaluate the device response.

Pass logic

Global command pass

The dropdown at the top of the template controls whether all commands or just one command must pass. It applies the same pass logic as the per-command setting, but at the template level.

OptionBehavior
All commands must pass (default)Every rule in every command must pass.
All commands must pass (warn/info as pass)No errors may be present in the template.
One command must pass (default)All rules in at least one command must pass.
One command must pass (warn/info as pass)At least one command with no errors must be present.

An optional pass checkbox ignores failures at warning or info severity. It is off by default.

Global pass dropdown and checkbox

Global rules pass

Each command has its own pass dropdown that applies pass logic at the command level.

OptionBehavior
All Rules must passEvery rule in the command must pass.
One Rule must passAt least one rule in the command must pass.
Per-command rules pass dropdown

Rules

Rules dropdown options
RuleDescription
containstrue if the device response contains the specified string.
!containstrue if the device response does not contain the specified string.
contains1true if the device response contains exactly one occurrence of the specified string.
RegExtrue if the device response matches the regular expression.
!RegExtrue if the device response does not match the regular expression.
#comparisonCompares two values, both of which may be extracted from the device response.

Every command may have one or more rules bound by a boolean pass flag:

  • Pass flag true (on) — AND logic: all rules must pass.
  • Pass flag false (off) — OR logic: at least one rule must pass.

Flags

Flag options by rule type
FlagDescriptionSupported by
iCase-insensitive matching.contains, RegEx, #comparison
gGlobal search; retains the index of the last match for iterative searches.RegEx, #comparison
mMulti-line; ^ and $ match the start and end of each line.RegEx, #comparison
contains rule with only the i flag
RegEx and comparison rules with i, g, and m flags

Severity

Severity applies only when a rule has failed. The default is error.

Severity options for a rule
LevelMeaning
errorSomething is wrong; a specific action may need to be taken.
warningSomething to be aware of that could potentially cause a problem.
infoInformational; no action required.

Variables

Use the following syntax to include a variable in a command:

<!VARIABLE!>

Supported types: string, number, boolean, array of strings, array of numbers, and array of booleans. When an array is passed, the command runs once per element. Arrays of objects are not supported.

Comparison rules

The contains and RegEx rules match (or exclude) a string or pattern in the device response. The #comparison rule extracts and compares two values.

RuleMatch typeReturnsFlags
containsStringtrue if the response contains the value.i
!containsStringtrue if the response does not contain the value.i
contains1Stringtrue if the response contains exactly one occurrence.i
RegExRegular expressiontrue if the response matches.i, g, m
!RegExRegular expressiontrue if the response does not match.i, g, m
#comparisonTwo extracted valuesDefined by the comparison operator.

Top operand

The top operand uses a regular expression with a capture group to extract a value from the command output.

  • Surround the expression with / characters: /Total System Memory:\s+(\d+) MB/
  • The capture group (in parentheses) defines the value to compare. Only one capture group is supported.

Bottom operand

The bottom operand is one of:

  • A static value
  • A command template variable (e.g., <!MEM-THRESH!>)
  • A regular expression with a capture group matching part of the command output

Comparison operators

OperatorTypeReturns
=Stringtrue if the operands are equal.
!=Stringtrue if the operands are not equal.
<Numbertrue if the top operand is less than the bottom.
<=Numbertrue if the top operand is less than or equal to the bottom.
>Numbertrue if the top operand is greater than the bottom.
>=Numbertrue if the top operand is greater than or equal to the bottom.
%NumberCalculates 100 × (bottom / top) and returns true if the result is ≤ the Max accepted % value.