New String & Regex Values

Check NetApp-REST introduces a breaking change beginning with v3.0.0.

Change

For parameters that previously expected a regular expression: Beginning with the v3.0.0 release, values which do not start with a tilde (~) are interpreted as strings that must match exactly, and not as regex patterns.

Motivation

The new notation is more intuitive, as the former could lead to false negatives, as shown in this example:
The option ‑‑exclude=vol1 also excluded vol10 or vol11 or even somevol123. Now, with the new notation, it does exactly what you would expect at first glance: it only excludes vol1.

The new interpretation in a nutshell:

  • If the value begins with a tilde (~), everything after the tilde is interpreted as regular expression. E.g. ‑‑exclude=~aggr0 excludes every aggregate whose name contains aggr0 in the name.
  • If the value does not begin with a tilde, it is interpreted as a string that must match exactly. For example, ‑‑exclude=aggr0 will only exclude the aggregate whose name is exactly aggr0.

Existing Configurations

This change may require adjustments to your existing configuration files if they contain options such as ‑‑exclude, ‑X, ‑‑include, ‑I, ‑‑ok-value, ‑‑ok-state or similar.

Typical changes are:

  • Anchored values like ‑‑exclude=^vol0$ must be changed to ‑‑exclude=vol0.
  • Patterns like ‑‑ok‑status=^(online|mixed)$ must be changed to ‑‑ok‑status=~^(online|mixed)$ (add a tilde in front of the value).

Further Reading

Further details and examples on this topic are on our page Regular Expressions


New NetApp-REST Checks: S3-Buckets, SnapMirror, Event-Count
v3.0.0 Released: Checks for Node-Hardware, Flexcache, Volume-State, Inodes in Aggregates and Volumes

Comments