Browse Source

icinga2: Ignore planned/staged/offline nodes when checking for iBGP sessions.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 5 years ago
parent
commit
558db78d7d
2 changed files with 15 additions and 0 deletions
  1. 9 0
      icinga2/bird_ibgp_sessions_down_ok.txt.tmpl
  2. 6 0
      icinga2/init.sls

+ 9 - 0
icinga2/bird_ibgp_sessions_down_ok.txt.tmpl

@@ -0,0 +1,9 @@
+#
+# Sessions which are OK to be down in iBGP (Salt managed)
+#
+{%- set nodes = salt['pillar.get']('nodes', {}) %}
+{%- for node, node_config in nodes.items ()|sort %}
+  {%- if node_config.get ('status', '') != "active" %}
+{{ salt['ffho.re_replace']('[.-]', '_', node) }}
+  {%- endif %}
+{%- endfor %}

+ 6 - 0
icinga2/init.sls

@@ -272,3 +272,9 @@ Cleanup /etc/icinga2/ffho-conf.d/net/wbbl/:
     - require:
       - file: /etc/icinga2/ffho-conf.d
 
+/etc/icinga2/ffho-conf.d/bird_ibgp_sessions_down_ok.txt:
+  file.managed:
+    - source: salt://icinga2/bird_ibgp_sessions_down_ok.txt.tmpl
+    - template: jinja
+    - require:
+      - file: /etc/icinga2/ffho-conf.d