nAttrMon’s .nattrmonignore

There are two mechanisms in nAttrMon to disable/enable objects, inputs, outputs and validations (or any kind of plug for that matter):

  1. moving the corresponding plug file to the folder *.disabled
  2. entering the plug file location on the file [nAttrMon config]/.nattrmonignore

Each mechanism has pros and cons:

Mechanism Pros Cons
*.disabled - File location determines if it’s in use or not.
- Enables shipment of sample plugs.
- Harder to keep a source versioned config where only small disables/enables are required per environment.
- Can get messy between sample plugs and customized disabled plugs.
.nattrmonignore - One file easy to ignore on source versioned configs.
- Textual description with comment/uncomment capability.
- Not immediately visible what is enabled and disabled.
- When using regular expressions can be powerfull and also “ambiguous”.
nattrmonignore.js - One file easy to ignore on source versioned configs.
- Can deal with all types of scenarios since it’s programmable (e.g. calling external services).
- Not visible what is enabled and disabled.
- Code legibility affects understanding of what its being ignored and why.

Both mechanisms co-exist and can be used when the pros/cons are right for each case.

.nattrmonignore syntax

Each line is processed with the following steps:

  1. Spaces are trimmed from the start and end of each line.
  2. If the line starts with a “#” it’s ignored and considered a comment.
  3. Each line is matched with each folder name and filename exact name to ignore plugs or plug directories.
  4. Each line is matched as a regular expression with each folder name and filename to ignore plugs or plugs directories.

Sample:

###
# The main configuration should not be considered
# a plug but kept on the inputs folder
inputs/config.yaml

### 
# Uncomment the corresponding line to disable a system input
#
#inputs/systems/a.yaml
#inputs/systems/b.yaml
#inputs/systems/c.yaml

###
# Comment the following lines to disable testing
inputs/test                    # folder
validations/test\..+\.yaml     # regular expression
outputs/test/myTestOutput.yaml # file