-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtest_vagrant.yml
76 lines (76 loc) · 2.17 KB
/
test_vagrant.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
- hosts: all
roles:
- ansible-prometheus
vars:
install_prometheus: true
install_alertmanager: true
install_blackbox_exporter: true
install_node_exporter: true
alertmanager_ip: "{{ ansible_eth1.ipv4.address }}"
# prometheus.yml
prometheus_external_labels:
datacenter: pdc
prometheus_rule_files:
- '/prometheus-data/alert.rules'
- '/prometheus-data/my_custom_rules.rules'
prometheus_scrape_configs:
- job_name: 'prometheus'
scrape_interval: 10s
scrape_timeout: 10s
static_configs:
- targets: ['localhost:9090']
- job_name: 'node_exporter'
scrape_interval: 5s
static_configs:
- targets:
- "{{ ansible_eth1.ipv4.address }}:9100"
- job_name: 'blackbox'
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- "{{ ansible_eth1.ipv4.address }}:9090"
relabel_configs:
- source_labels: [__address__]
regex: (.*)(:9090)?
target_label: __param_target
replacement: ${1}
- source_labels: [__param_target]
regex: (.*)
target_label: instance
replacement: ${1}
- source_labels: []
regex: .*
target_label: __address__
replacement: "{{ ansible_eth1.ipv4.address }}:9115" # Blackbox exporter.
# alertmanager.yml
alertmanager_route:
group_by: ['cluster','alertname','host']
group_wait: 30s
group_interval: 2m
repeat_interval: 10m
receiver: slack_general
routes:
- match:
severity: warning
receiver: slack_general
- match:
severity: critical
receiver: slack_general
continue: true
- match:
severity: critical
receiver: pagerduty_uk
continue: true
alertmanager_receivers:
- name: slack_general
slack_configs:
- send_resolved: true
api_url: 'https://hooks.slack.com/services/XXX/XXXXX/XXXXXXXXXXX'
channel: '#alerts'
- name: pagerduty_uk
pagerduty_configs:
- service_key: XXXXXXXXXXXXXXX
send_resolved: true