Let's have a look at notifications first:
In the "edit alarm notifications" modal, you can match on mnemonic and device which can both contain the hostname. Knowing this, we can use either of these two fields to include or exclude specific devices based on their hostnames. Additionally, regex can be used to filter against a pattern to match multiple devices. Please see the Iris Regular Expressions Cheat Sheet page for a more general discussion of how regular expressions are created.
Let's have a look at an example:
- to exclude "abc-router-02.xyz" and "abc-router-03.xyz" from generating alarms and/or notifications, the regex would look like:
- if you wanted to include those same 2 devices and exclude everything else:
- another variation of exclusion could look like the following to include all devices with "switch" in the name, beginning with "abc" or "ghi", and ending in .rst:
The easiest way to test these and to understand how they work is possibly to see them in action (with an explanation of the role of each piece of the regex) - https://regex101.com is one of a number of helpful sites in this regard. To test the examples I've provided above, paste the regex I've given into the "regular expression" field, set the flag to the right of that line to include multi-line (to process multiple lines), and paste the list of devices into the "test string" box. Based on the regex, you should see a number of devices highlighted in green, and some that aren't - this will change depending on the regex used. The lines in green will be included in alarms/notifications and the others won't.
As mentioned at the beginning of this article, this was geared towards notifications. This means that events/alarms will still be generated despite the exclusions - this is ONLY to exclude sending notifications for the matched devices. To prevent events/alarms being generated, you can do this via the "edit thresholds" modal by regex filtering based on element or mnemonic.