global: scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. # scrape_timeout is set to the global default (10s). alerting: alertmanagers: - static_configs: - targets: ['localhost:9093'] rule_files: - "/etc/prometheus/alerting_rules.yml" scrape_configs: - job_name: 'prometheus' scrape_interval: 5s scrape_timeout: 5s static_configs: - targets: ['localhost:9090'] - targets: ["{{ hostvars['monitoring01']['ip'] }}:9090"] {% for group in ['accesspoints', 'switches', 'gateways', 'server', 'vms'] %} - job_name: {{ group }} static_configs: {% for host in groups[group] %} - targets: ["{{ hostvars[host]['monitoring_ip'] | default(hostvars[host]['ip']) }}:9100"] labels: instance: "{{ host }}:9100" {% if hostvars[host]['site'] is defined %} site: "{{ hostvars[host]['site'] }}" {% endif %} {% if hostvars[host]['location'] is defined %} location: "{{ hostvars[host]['location'] }}" {% endif %} {% endfor %} {% endfor %} - job_name: 'snmp' static_configs: {% for host in groups['switches_stock'] %} - targets: ["{{ hostvars[host]['ip'] }}"] labels: instance: "{{ host }}" {% if hostvars[host]['site'] is defined %} site: "{{ hostvars[host]['site'] }}" {% endif %} {% if hostvars[host]['location'] is defined %} location: "{{ hostvars[host]['location'] }}" {% endif %} {% endfor %} metrics_path: /snmp params: module: [if_mib] relabel_configs: - source_labels: [__address__] target_label: __param_target - target_label: __address__ replacement: 127.0.0.1:9116 # The SNMP exporter's real hostname:port. - job_name: 'blackbox' static_configs: - targets: - {{ hostvars['mon-e2e-clients01']['ip'] }}:9115 - job_name: 'e2e_adp_clients_v4' metrics_path: /probe params: module: [icmp_v4] static_configs: - targets: - freifunk-leipzig.de - harald.brainpeach.de relabel_configs: - source_labels: [__address__] target_label: __param_target - source_labels: [__param_target] target_label: instance - target_label: __address__ replacement: {{ hostvars['mon-e2e-clients01']['ip'] }}:9115