playbooks: add ffmwu-monitoring to set up prometheus servers
This commit is contained in:
parent
8d7af519a5
commit
ae243c872f
5 changed files with 88 additions and 0 deletions
1
inventory/ffmwu-monitoring
Normal file
1
inventory/ffmwu-monitoring
Normal file
|
@ -0,0 +1 @@
|
|||
[ffmwu-monitoring]
|
|
@ -12,6 +12,12 @@ bgp_ipv4_transfer_net: 10.37.0.0/18
|
|||
bgp_ipv6_transfer_net: fd37:b4dc:4b1e::/64
|
||||
bgp_groups:
|
||||
- ffmwu-gateways
|
||||
- ffmwu-monitoring
|
||||
|
||||
prometheus_groups:
|
||||
- ffmwu-gateways
|
||||
|
||||
prometheus_conf_main: prometheus/prometheus.yml.j2
|
||||
|
||||
http_domain_internal: ffmwu.org
|
||||
http_domain_external: freifunk-mwu.de
|
||||
|
|
13
inventory/group_vars/ffmwu-monitoring
Normal file
13
inventory/group_vars/ffmwu-monitoring
Normal file
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
routing_tables:
|
||||
mwu: 41
|
||||
|
||||
common_repos:
|
||||
backend-scripts:
|
||||
repo_url: https://github.com/freifunk-mwu/backend-scripts.git
|
||||
version: ansible
|
||||
|
||||
prometheus_components:
|
||||
- prometheus
|
||||
- alertmanager
|
||||
- node_exporter
|
26
playbooks/monitoring.yml
Executable file
26
playbooks/monitoring.yml
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/ansible-playbook
|
||||
|
||||
- hosts: ffmwu-monitoring
|
||||
remote_user: admin
|
||||
roles:
|
||||
- prerequisites
|
||||
- server-apt-repos
|
||||
- server-basic
|
||||
- users
|
||||
- system-sysctl
|
||||
- git-repos
|
||||
- service-haveged
|
||||
- service-ntpd
|
||||
- kmod-batman
|
||||
- network-routetables
|
||||
- network-batman
|
||||
- network-meshbridge
|
||||
- network-fastd
|
||||
- network-routing
|
||||
- service-nginx
|
||||
- service-fastd
|
||||
- service-fastd-backbone
|
||||
- service-bird
|
||||
- service-respondd
|
||||
- service-nullmailer
|
||||
- service-prometheus
|
42
playbooks/prometheus/prometheus.yml.j2
Normal file
42
playbooks/prometheus/prometheus.yml.j2
Normal file
|
@ -0,0 +1,42 @@
|
|||
global:
|
||||
scrape_interval: 15s # By default, scrape targets every 15 seconds.
|
||||
evaluation_interval: 15s # By default, scrape targets every 15 seconds.
|
||||
# scrape_timeout is set to the global default (10s).
|
||||
|
||||
# The labels to add to any time series or alerts when communicating with
|
||||
# external systems (federation, remote storage, Alertmanager).
|
||||
external_labels:
|
||||
monitor: 'master'
|
||||
|
||||
{% if prometheus_rule_files is defined %}
|
||||
# Rule files specifies a list of files from which rules are read.
|
||||
rule_files:
|
||||
{% for (key, value) in prometheus_rule_files.items() %}
|
||||
- {{ prometheus_rule_path }}/{{ value.dest }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
# A list of scrape configurations.
|
||||
scrape_configs:
|
||||
|
||||
- job_name: 'prometheus'
|
||||
scrape_interval: 10s
|
||||
scrape_timeout: 10s
|
||||
static_configs:
|
||||
- targets: ['localhost:9090', 'localhost:9100']
|
||||
|
||||
- job_name: "node"
|
||||
file_sd_configs:
|
||||
- files:
|
||||
- '{{ prometheus_file_sd_config_path }}/*.json'
|
||||
- '{{ prometheus_file_sd_config_path }}/*.yml'
|
||||
- '{{ prometheus_file_sd_config_path }}/*.yaml'
|
||||
static_configs:
|
||||
{%for group in prometheus_groups %}
|
||||
- targets:
|
||||
{% for host in groups[group] %}
|
||||
- '{{ host }}:9100'
|
||||
{% endfor %}
|
||||
labels:
|
||||
group: '{{ group }}'
|
||||
{% endfor %}
|
Loading…
Reference in a new issue