Show only CRITICAL/WARNING instances

The overall-checks have the option --show-instances to print only instances of a specific state (exit-code).

Usage:

--show-instances=exit-code[,exit-code, ...] where exit-code is one of: OK, CRITICAL, WARNING or UNKNOWN.

For example:

--show-instances=CRITICAL (show only CRITICAL instances in the message)

--show-instances=CRITICAL,WARNING (show only CRITICAL and WARNING instances in the message)

--show-instances=OK,CRITICAL,WARNING,UNKNOWN (show any instance in the message - which is the default)

Practical examples

Disk container-type check

The list of disks can get quite long. Almost all disks will be ok.

$ check_netapp_disk container-type -H filer
NETAPP DISK CONTAINER TYPE CRITICAL - 28 disks checked, 2 CRITICAL
sim96cluster-01.NET-1.7: unassigned (CRITICAL)
sim96cluster-01.NET-1.8: broken (CRITICAL)
sim96cluster-01.NET-1.28: spare
sim96cluster-01.NET-1.25: aggregate
sim96cluster-01.NET-1.24: aggregate
sim96cluster-01.NET-1.23: aggregate
sim96cluster-01.NET-1.22: aggregate
sim96cluster-01.NET-1.21: aggregate
sim96cluster-01.NET-1.20: aggregate
sim96cluster-01.NET-1.19: spare
sim96cluster-01.NET-1.18: spare
sim96cluster-01.NET-1.17: aggregate
sim96cluster-01.NET-1.16: aggregate
sim96cluster-01.NET-1.15: aggregate
sim96cluster-01.NET-1.14: aggregate
sim96cluster-01.NET-1.13: aggregate
sim96cluster-01.NET-1.12: aggregate
sim96cluster-01.NET-1.11: aggregate
sim96cluster-01.NET-1.10: aggregate
sim96cluster-01.NET-1.9: aggregate
sim96cluster-01.NET-1.26: aggregate
sim96cluster-01.NET-1.27: spare
sim96cluster-01.NET-1.6: spare
sim96cluster-01.NET-1.5: spare
sim96cluster-01.NET-1.4: spare
sim96cluster-01.NET-1.3: aggregate
sim96cluster-01.NET-1.2: aggregate
sim96cluster-01.NET-1.1: aggregate

To shorten the above list, and show only the ones which are not ok, may make sense. This can be achieved with:

$ check_netapp_disk container-type -H filer --show-instances=CRITICAL
NETAPP DISK CONTAINER TYPE CRITICAL - 28 disks checked, 2 CRITICAL
sim96cluster-01.NET-1.7: unassigned (CRITICAL)
sim96cluster-01.NET-1.8: broken (CRITICAL)