prometheus: cleanup

This commit is contained in:
Markus 2020-05-25 15:52:28 +02:00
parent d710bd841b
commit 1af46b5e28
3 changed files with 12 additions and 6 deletions

View File

@ -44,12 +44,12 @@ ntp_servers:
- 2.de.pool.ntp.org - 2.de.pool.ntp.org
- 3.de.pool.ntp.org - 3.de.pool.ntp.org
prometheus_pve_user: prometheus@pve
prometheus_pve_pass: "{{ vault_prometheus_pve_pass }}"
pve_targets: pve_targets:
- pve01.ffrgb - pve01.ffrgb
- pve02.ffrgb - pve02.ffrgb
prometheus_pve_user: prometheus@pve
prometheus_pve_pass: "{{ vault_prometheus_pve_pass }}"
site: ffrgb site: ffrgb
site_domain: regensburg.freifunk.net site_domain: regensburg.freifunk.net

View File

@ -1,10 +1,10 @@
--- ---
- name: Reload systemd
command: systemctl daemon-reload
- name: Restart prometheus - name: Restart prometheus
service: name=prometheus state=restarted service: name=prometheus state=restarted
- name: Restart prometheus-pve-exporter - name: Restart prometheus-pve-exporter
service: name=prometheus-pve-exporter state=restarted service: name=prometheus-pve-exporter state=restarted
- name: Reload systemd
command: systemctl daemon-reload

View File

@ -25,18 +25,23 @@ rule_files:
# A scrape configuration containing exactly one endpoint to scrape: # A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself. # Here it's Prometheus itself.
scrape_configs: scrape_configs:
{% if node_targets is defined %}
- job_name: node - job_name: node
static_configs: static_configs:
- targets: - targets:
{% for target in node_targets %} {% for target in node_targets %}
- {{ target }} - {{ target }}
{% endfor %} {% endfor %}
{% endif %}
{% if fastd_targets is defined %}
- job_name: fastd - job_name: fastd
static_configs: static_configs:
- targets: - targets:
{% for target in fastd_targets %} {% for target in fastd_targets %}
- {{ target }} - {{ target }}
{% endfor %} {% endfor %}
{% endif %}
{% if pve_targets is defined %}
- job_name: pve - job_name: pve
static_configs: static_configs:
- targets: - targets:
@ -53,3 +58,4 @@ scrape_configs:
target_label: instance target_label: instance
- target_label: __address__ - target_label: __address__
replacement: 127.0.0.1:9221 replacement: 127.0.0.1:9221
{% endif %}