@@ -9,30 +9,65 @@ describe the overall alerting process:
9
9
sending out notifications via methods such as email, on-call notification
10
10
systems, and chat platforms.
11
11
12
- By default, both a ` prometheus ` server and an ` alertmanager ` server are
13
- deployed on the control node for new environments:
12
+ The general Prometheus configuration is described in
13
+ [ monitoring-and-logging.md] ( ./monitoring-and-logging.md#defaults-3 ) - note that
14
+ section specifies some role variables which commonly need modification.
15
+
16
+ The alertmanager server is defined by the [ ansible/roles/alertmanager] ( ../ansible/roles/alertmanager/README.md ) ,
17
+ and all the configuration options and defaults are defined there. The defaults
18
+ are fully functional, except that a [ receiver] ( https://prometheus.io/docs/alerting/latest/configuration/#receiver )
19
+ must be configured to generate notifications.
20
+
21
+ ## Enabling alertmanager
22
+
23
+ 1 . Ensure both the ` prometheus ` and ` alertmanager ` servers are deployed on the
24
+ control node - for new environments the ` cookiecutter ` tool will have done
25
+ this:
26
+
27
+ ```ini
28
+ # environments/site/groups:
29
+ [prometheus:children]
30
+ control
31
+
32
+ [alertmanager:children]
33
+ control
34
+ ```
35
+
36
+ 2 . If the appliance was deployed before the alertmanager functionality was included,
37
+ generate a password for the alertmanager UI user:
14
38
15
- ``` ini
16
- # environments/site/groups:
17
- [prometheus:children]
18
- control
39
+ ```shell
40
+ ansible-playbook ansible/adhoc/generate-passwords.yml
41
+ ```
19
42
20
- [alertmanager:children]
21
- control
43
+ 3 . Configure a receiver to generate notifications from alerts. Currently a Slack
44
+ integration is provided (see below) but alternative receivers could be defined
45
+ via overriding role defaults.
46
+
47
+ 4 . If desired, any other [ role defaults] ( ../ansible/roles/alertmanager/README.md )
48
+ may be overriden in e.g. ` environments/site/inventory/group_vars/all/alertmanager.yml ` .
49
+
50
+ 5 . Run the ` monitoring.yml ` playbook (if the cluster is already up) to configure
51
+ both alertmanager and prometheus:
52
+
53
+ ```shell
54
+ ansible-playbook ansible/monitoring.yml
55
+ ```
56
+
57
+ ## Access
58
+
59
+ There is a web interface provided by the alertmanager server. The default
60
+ address can be seen using:
61
+
62
+ ``` shell
63
+ ansible localhost -m debug -a var=alertmanager_web_external_url
22
64
```
23
65
24
- The general Prometheus configuration is described in
25
- [ monitoring-and-logging.md] ( ./monitoring-and-logging.md#defaults-3 ) - note this
26
- section specifies some role variables which commonly need modification.
66
+ The user is ` alertmanager ` and the autogenerated password can be seen using:
27
67
28
- The alertmanager server is defined by the [ ansible/roles/alertmanager] ( ../ansible/roles/alertmanager/README.md ) ,
29
- and all the configuration options and defaults are defined there. By default
30
- it will be fully functional but:
31
- - ` alertmanager_web_external_url ` is likely to require modification.
32
- - A [ receiver] ( https://prometheus.io/docs/alerting/latest/configuration/#receiver )
33
- must be defined to actually provide notifications. Currently a Slack receiver
34
- integration is provided (see below) but alternative receivers
35
- could be defined using the provided role variables.
68
+ ``` shell
69
+ ansible localhost -m debug -a var=vault_alertmanager_admin_password
70
+ ```
36
71
37
72
## Slack receiver
38
73
@@ -72,10 +107,11 @@ of alerts via Slack.
72
107
## Alerting Rules
73
108
74
109
These are part of [ Prometheus configuration] ( https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/ )
75
- which is defined appliance at
110
+ which is defined for the appliance at
76
111
[ environments/common/inventory/group_vars/all/prometheus.yml] ( ../environments/common/inventory/group_vars/all/prometheus.yml ) .
77
112
78
- Two ` cloudalchemy.prometheus ` role variables are relevant:
113
+ Two [ cloudalchemy.prometheus] ( https://github.com/cloudalchemy/ansible-prometheus )
114
+ role variables are relevant:
79
115
- ` prometheus_alert_rules_files ` : Paths to check for files providing rules.
80
116
Note these are copied to Prometheus config directly, so jinja expressions for
81
117
Prometheus do not need escaping.
0 commit comments