Filters

Filters select objects from a result list. If you specify a filter, SNClient uses only matching items in the final result.

The warning/critical/ok thresholds use the same syntax. A matching threshold sets the corresponding status.

Syntax

All filters follow the syntax <attribute> <operator> <value>. See the operator list for the allowed operators and their meanings.

Each check plugin documents its available attributes.

Common attributes are listed at the end of this page.

For example:

filter="status = 'started'"

See the expressions page for syntax details.

SNClient combines multiple filters with a logical OR.

For example:

filter="drive = 'C:'" filter="drive = 'D:'"

Filter As Excludes

By default, filters form an inclusion list. With the appropriate operator, they can also exclude items.

For example:

filter="fstype not in ('tmpfs', 'debugfs')"

Default Filter

Some checks have a default filter. SNClient uses it if you do not supply a filter as a check argument.

Each check plugin documents its default filters.

To unset the default filter, use a none filter. For example:

filter="none"

A new filter replaces the default filter.

Extending Filters

To extend a default filter, use the filter+="..." syntax. For example:

filter+="status = 'started'"

When you extend the default filter, SNClient combines all filters with a logical AND.

For example:

default filter="fstype is not tmpfs"

filter += "fstype is not debugfs"

results in:

fstype is not tmpfs AND fstype is not debugfs

The same applies to appending to previously set filters:

For example:

filter="fstype is not tmpfs"    filter+="fstype is not debugfs"

also results in:

fstype is not tmpfs AND fstype is not debugfs

Expressions

See the expressions page for details.

Common Filter Attributes

AttributeDescription
statusThe returned status (OK/WARN/CRIT/UNKNOWN)
countNumber of items matching the filter.
totalTotal number of items
listList of all items matching the filter.
ok_countNumber of items that are OK
ok_listList of items that are OK
warn_countNumber of items that matched the warning threshold
warn_listList of items that matched the warning threshold
crit_countNumber of items that matched the critical threshold
crit_listList of items that matched the critical threshold
problem_countNumber of items that matched either warning or critical threshold
problem_listList of items that matched either warning or critical threshold