30 lines
733 B
Django/Jinja
30 lines
733 B
Django/Jinja
global:
|
|
scrape_interval: 15s
|
|
|
|
scrape_configs:
|
|
- job_name: "prometheus"
|
|
scrape_interval: 15s
|
|
basic_auth:
|
|
username: "{{ prom_admin_user }}"
|
|
password: "{{ prom_admin_password }}"
|
|
static_configs:
|
|
- targets: ["localhost:9090"]
|
|
|
|
- job_name: "node_exporter"
|
|
basic_auth:
|
|
username: "{{ exporter_user }}"
|
|
password: "{{ exporter_password }}"
|
|
static_configs:
|
|
{% for host in groups['servers'] %}
|
|
- targets: ["{{ hostvars[host]['ansible_host'] }}:9100"]
|
|
labels:
|
|
nodename: "{{ host }}"
|
|
{% endfor %}
|
|
|
|
alerting:
|
|
alertmanagers:
|
|
- static_configs:
|
|
- targets: ['alertmanager:9093']
|
|
rule_files:
|
|
- /etc/prometheus/alerts.rules.yml
|