|
1
|
# yamllint disable rule:line-length |
|
2
|
--- |
|
3
|
- id: 'notify-email' |
|
4
|
meta: |
|
5
|
name: 'Email' |
|
6
|
link: '' |
|
7
|
categories: |
|
8
|
- notify.agent |
|
9
|
icon_filename: 'email.png' |
|
10
|
keywords: |
|
11
|
- email |
|
12
|
overview: |
|
13
|
notification_description: | |
|
14
|
Send notifications via Email using Netdata's Agent alert notification feature, which supports dozens of endpoints, user roles, and more. |
|
15
|
notification_limitations: '' |
|
16
|
setup: |
|
17
|
prerequisites: |
|
18
|
list: |
|
19
|
- title: '' |
|
20
|
description: | |
|
21
|
- A working sendmail command is required for email alerts to work. Almost all MTAs provide a sendmail interface. Netdata sends all emails as user netdata, so make sure your sendmail works for local users. |
|
22
|
- Access to the terminal where Netdata Agent is running |
|
23
|
- When running Netdata with Docker Compose the emails are sent with `msmtp`, and you need a basic configuration for it to work. |
|
24
|
|
|
25
|
- Add a [msmtprc](https://marlam.de/msmtp/msmtprc.txt) config file on your Docker root folder, and edit it according to your needs. |
|
26
|
- Link it into your Netdata container with this: |
|
27
|
|
|
28
|
```yaml |
|
29
|
volumes: |
|
30
|
- /path/to/netdata-docker/msmtprc:/etc/msmtprc:ro |
|
31
|
``` |
|
32
|
|
|
33
|
- Update your container with `docker compose up -d`. |
|
34
|
|
|
35
|
configuration: |
|
36
|
file: |
|
37
|
name: 'health_alarm_notify.conf' |
|
38
|
options: |
|
39
|
description: 'The following options can be defined for this notification' |
|
40
|
folding: |
|
41
|
title: 'Config Options' |
|
42
|
enabled: true |
|
43
|
list: |
|
44
|
- name: 'EMAIL_SENDER' |
|
45
|
default_value: 'netdata' |
|
46
|
description: "You can change `EMAIL_SENDER` to the email address sending the notifications." |
|
47
|
required: false |
|
48
|
- name: 'SEND_EMAIL' |
|
49
|
default_value: 'AUTO' |
|
50
|
description: "Set `SEND_EMAIL` to YES, NO, or AUTO (enables email when sendmail is available)." |
|
51
|
required: true |
|
52
|
- name: 'DEFAULT_RECIPIENT_EMAIL' |
|
53
|
default_value: 'root' |
|
54
|
description: "Set `DEFAULT_RECIPIENT_EMAIL` to the email address you want the email to be sent by default. You can define multiple email addresses like this: `alarms@example.com` `systems@example.com`." |
|
55
|
required: true |
|
56
|
detailed_description: | |
|
57
|
All roles will default to this variable if left unconfigured. |
|
58
|
The `DEFAULT_RECIPIENT_CUSTOM` can be edited in the following entries at the bottom of the same file: |
|
59
|
```text |
|
60
|
role_recipients_email[sysadmin]="systems@example.com" |
|
61
|
role_recipients_email[domainadmin]="domains@example.com" |
|
62
|
role_recipients_email[dba]="databases@example.com systems@example.com" |
|
63
|
role_recipients_email[webmaster]="marketing@example.com development@example.com" |
|
64
|
role_recipients_email[proxyadmin]="proxy-admin@example.com" |
|
65
|
role_recipients_email[sitemgr]="sites@example.com" |
|
66
|
``` |
|
67
|
examples: |
|
68
|
folding: |
|
69
|
enabled: true |
|
70
|
title: '' |
|
71
|
list: |
|
72
|
- name: 'Basic Configuration' |
|
73
|
folding: |
|
74
|
enabled: false |
|
75
|
description: '' |
|
76
|
config: | |
|
77
|
#------------------------------------------------------------------------------ |
|
78
|
# email global notification options |
|
79
|
|
|
80
|
EMAIL_SENDER="example@domain.com" |
|
81
|
SEND_EMAIL="YES" |
|
82
|
DEFAULT_RECIPIENT_EMAIL="recipient@example.com" |
|
83
|
troubleshooting: |
|
84
|
problems: |
|
85
|
list: [] |