From 8916f8fa2167abad24cfdd2a9e305160d83a6958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Duchaussois?= Date: Wed, 28 Apr 2021 16:49:16 +0200 Subject: feature: add sensor configuration --- templates/health_template.j2 | 6 ++++++ templates/netdata_alarm.conf.j2 | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 templates/health_template.j2 create mode 100644 templates/netdata_alarm.conf.j2 (limited to 'templates') diff --git a/templates/health_template.j2 b/templates/health_template.j2 new file mode 100644 index 0000000..2e67b96 --- /dev/null +++ b/templates/health_template.j2 @@ -0,0 +1,6 @@ +{% for template in collector.health_config %} +template = {{ template.name }} +{% for config in template.definition %} +{{ config }} +{% endfor %} +{% endfor %} diff --git a/templates/netdata_alarm.conf.j2 b/templates/netdata_alarm.conf.j2 new file mode 100644 index 0000000..c689a95 --- /dev/null +++ b/templates/netdata_alarm.conf.j2 @@ -0,0 +1,21 @@ +{% for alarm in collector.alarm_config %} +{% if alarm.template is defined -%} +template: {{ alarm.template }} +families: {{ alarm.families | default("*") }} +{% else %} + alarm: {{ alarm.alarm | default( collector.name ) }} +{% endif %} + on: {{ alarm.on_what }} + os: {{ alarm.os | default("*") }} + hosts: {{ alarm.os | default("*") }} + lookup: {{ alarm.lookup }} +{% if alarm.calc is defined %} + calc: {{ alarm.calc }} +{% endif %} + every: {{ alarm.every | default("1m") }} + warn: {{ alarm.warn | default("$status == $WARNING") }} + crit: {{ alarm.crit | default("$status == $CRITICAL") }} + delay: {{ alarm.delay | default("up 0 down 0 multiplier 1.0 max 0") }} + to: {{ alarm.to | default("silent") }} + +{% endfor %} -- cgit v1.2.3