Browse Source

icinga2: Don't notify for nodes which aren't operational.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
Maximilian Wilhelm 6 years ago
parent
commit
508887a45b
1 changed files with 7 additions and 0 deletions
  1. 7 0
      icinga2/host.conf.tmpl

+ 7 - 0
icinga2/host.conf.tmpl

@@ -6,6 +6,7 @@
 {%- set address = salt['ffho_net.get_loopback_ip'] (node_config, node_id, 'v4') %}
 {%- set address6 = salt['ffho_net.get_loopback_ip'] (node_config, node_id, 'v6') %}
 {%- set monitoring_config = node_config.get ('monitoring', {}) %}
+{%- set state = node_config.get ('state', 'operation') %}
 
 {%- if 'icinga2server' not in roles %}
 object Endpoint "{{ node_id }}" {
@@ -26,6 +27,12 @@ object Host "{{ node_id }}" {
 	address = "{{ address }}"
 	address6 = "{{ address6 }}"
 
+{%- if state != 'operation' %}
+
+	# This node has state {{ state }}, don't whine about anything here
+	enable_notifications = false
+{%- endif %}
+
 	vars.os = "Linux"
 
 	vars.roles = [