Bläddra i källkod

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

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 5 år sedan
förälder
incheckning
558db78d7d
2 ändrade filer med 15 tillägg och 0 borttagningar
  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