Browse Source

prometheus-server: Scrape routers (bird_exporter)

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 1 year ago
parent
commit
b1dbf6c161
1 changed files with 12 additions and 2 deletions
  1. 12 2
      prometheus-server/prometheus.yml

+ 12 - 2
prometheus-server/prometheus.yml

@@ -1,3 +1,4 @@
+{%- set nodes = salt['pillar.get']('nodes').items()|sort -%}
 #
 #
 # /etc/prometheus/prometheus.yaml (Salt managed)
 # /etc/prometheus/prometheus.yaml (Salt managed)
 #
 #
@@ -30,15 +31,24 @@ scrape_configs:
   - job_name: node
   - job_name: node
     static_configs:
     static_configs:
       - targets:
       - targets:
-{%- for node, node_config in salt['pillar.get']('nodes').items()|sort %}
+{%- for node, node_config in nodes %}
         - {{ node }}:9100
         - {{ node }}:9100
 {%- endfor %}
 {%- endfor %}
 
 
   - job_name: bind
   - job_name: bind
     static_configs:
     static_configs:
       - targets:
       - targets:
-{%- for node, node_config in salt['pillar.get']('nodes').items()|sort %}
+{%- for node, node_config in nodes %}
   {%- if salt['ffho.any_item_in_list'](['dns-auth', 'dns-recursor'], node_config.get('roles', [])) %}
   {%- if salt['ffho.any_item_in_list'](['dns-auth', 'dns-recursor'], node_config.get('roles', [])) %}
         - {{ node }}:9119
         - {{ node }}:9119
   {%- endif %}
   {%- endif %}
 {%- endfor %}
 {%- endfor %}
+
+  - job_name: bird
+    static_configs:
+      - targets:
+{%- for node, node_config in nodes %}
+  {%- if 'router' in node_config.get('roles', []) %}
+        - {{ node }}:9324
+  {%- endif %}
+{%- endfor %}