|
| 1 | +# Global Alertmanager runtime and SMTP settings. |
1 | 2 | global: |
2 | | - resolve_timeout: 5m |
3 | | - smtp_from: alert@openim.io |
4 | | - smtp_smarthost: smtp.163.com:465 |
5 | | - smtp_auth_username: alert@openim.io |
6 | | - smtp_auth_password: YOURAUTHPASSWORD |
7 | | - smtp_require_tls: false |
8 | | - smtp_hello: xxx |
| 3 | + resolve_timeout: 5m # Wait time before an alert is considered resolved when no further updates are received. |
| 4 | + smtp_from: alert@openim.io # Sender address displayed in alert emails. |
| 5 | + smtp_smarthost: smtp.163.com:465 # SMTP relay endpoint in host:port format. |
| 6 | + smtp_auth_username: alert@openim.io # SMTP authentication username (commonly the same as smtp_from). |
| 7 | + smtp_auth_password: YOURAUTHPASSWORD # SMTP authorization token or app password. |
| 8 | + smtp_require_tls: false # Set to true when your SMTP provider requires STARTTLS. |
| 9 | + smtp_hello: xxx # HELO/EHLO identity presented to the SMTP server. |
9 | 10 |
|
10 | 11 | templates: |
11 | | - - /etc/alertmanager/email.tmpl |
| 12 | + - /etc/alertmanager/email.tmpl # Go template file used to render HTML email content. |
12 | 13 |
|
| 14 | +# Root routing tree for all incoming alerts. |
13 | 15 | route: |
14 | | - group_by: [ 'alertname' ] |
15 | | - group_wait: 5s |
16 | | - group_interval: 5s |
17 | | - repeat_interval: 5m |
18 | | - receiver: email |
| 16 | + group_by: [ 'alertname' ] # Alerts sharing this label value are batched into one notification. |
| 17 | + group_wait: 5s # Initial delay before sending the first notification for a new alert group. |
| 18 | + group_interval: 5s # Minimum interval between notifications for the same alert group. |
| 19 | + repeat_interval: 5m # Reminder interval while an alert group remains firing. |
| 20 | + receiver: email # Default receiver when no child route matches. |
19 | 21 | routes: |
20 | 22 | - matchers: |
21 | | - - alertname = "XXX" |
22 | | - group_by: [ 'instance' ] |
| 23 | + - alertname = "XXX" # Example matcher; replace with a real alert name or remove this route. |
| 24 | + group_by: [ 'instance' ] # Override grouping for this specific route. |
23 | 25 | group_wait: 5s |
24 | 26 | group_interval: 5s |
25 | 27 | repeat_interval: 5m |
26 | 28 | receiver: email |
27 | 29 |
|
28 | 30 | receivers: |
29 | | - - name: email |
| 31 | + - name: email # Receiver name referenced by route.receiver. |
30 | 32 | email_configs: |
31 | | - - to: 'alert@example.com' |
32 | | - html: '{{ template "email.to.html" . }}' |
33 | | - headers: { Subject: "[OPENIM-SERVER]Alarm" } |
34 | | - send_resolved: true |
| 33 | + - to: 'alert@example.com' # Recipient mailbox for alert notifications. |
| 34 | + html: '{{ template "email.to.html" . }}' # Rendered with the template declared in email.tmpl. |
| 35 | + headers: { Subject: "[OPENIM-SERVER]Alarm" } # Custom email subject line. |
| 36 | + send_resolved: true # Also send a notification when the alert recovers. |
0 commit comments