Hello @Eddie ,
Firstly I have to apologize you, I was busy with other PR.
I will give examples for you and if I am not clear, please, let me know and also you can read more details about simple pattern here.
For the first example you used:
bash-5.0# netdata -W simple-pattern '!abc *' 'abc'
RESULT: NOT MATCHED - pattern '!abc *' does not match 'abc', wildcarded ''
bash-5.0# netdata -W simple-pattern '!abc *' 'cde'
RESULT: MATCHED - pattern '!abc *' matches 'cde', wildcarded ''
As you can see Netdata will never match nothing with abc
, but will match other texts. The same thing will happen with cgroup_abc
:
bash-5.0# netdata -W simple-pattern '!cgroup_abc *' 'abc'
RESULT: MATCHED - pattern '!cgroup_abc *' matches 'abc', wildcarded ''
bash-5.0# netdata -W simple-pattern '!cgroup_abc *' 'cgroup_abc'
RESULT: NOT MATCHED - pattern '!cgroup_abc *' does not match 'cgroup_abc', wildcarded ''
Please, pay attention for the fact if two hosts
are given to template, only the last will be used, because it overwrites the first.
you can identify the names used by netdata running /usr/libexec/netdata/plugins.d/system-info.sh
.
You can store all your templates
or alarms
inside /etc/netdata/health.d
. They will never be discarded after the restart, instead, when you store them in the directory, it will be loaded every time you restart Netdata.
Finally you can build a template, you can use this example:
template: dev_dim_template
on: system.cpu
os: linux
lookup: sum -3s at 0 every 3 percentage foreach system,user,nice
units: %
every: 1s
warn: $this > 1
crit: $this > 4
hosts: !abc *
This is a modified example that we have inside Netdata tests directory.
This example applies an alarm to all hosts that are not named abc
on charts with context system.cpu
.
Best regards!