5.4.4.4 The "rules" File

All event notification add-ons provide a filter function for the event messages to forward. Using filter rules defined in the "rules" file, the software forwards only messages which match one of the rules specified in the "rules" file.

The name of the rules file has to be specified in the respective add-on settings file by the keyword ruleFileName. By default the filename is just rules. But if you run more the one add-on you may want to use a different rule file for each add-on.

Example:

ruleFileName=rules

This file is a plain text file containing one rule per line. Empty lines and comment lines (starting with a '#'-character) are ignored. Each rule has the format <device-name>:<text-pattern>, where both parts may be replaced by * as a general wildcard. A rule matches, if the event source matches the given device name and if the message text contains the given text pattern.

Here some example rules:

   HPA-1:FAULT              matches messages from HPA-1 containing
                            "FAULT" in the event message text.
   
   HPA-2:*                  matches all messages from device HPA-2

   *:Lock                   matches messages from all devices which
                            contain "Lock" in the message text
   
   *:*                      matches all messages.

If the rules file is missing or empty, the software assumes a *:* rule. A standard installation includes already the file /home/satnms/rules with the default setting and some examples.