@@ -11,30 +11,28 @@ Overview
11
11
[thumbnail="screenshot/gui-datacenter-notification-overview.png"]
12
12
13
13
* {pve} emits xref:notification_events[Notification Events] in case of
14
- storage replication failures, node fencing, finished/failed backups
15
- and other events.
16
- These events are handled by the notification system. A notification
17
- event has metadata, for example a timestamp, a severity level,
18
- a type, and other optional metadata fields.
14
+ storage replication failures, node fencing, finished/failed backups and other
15
+ events.
16
+ These events are handled by the notification system. A notification event has
17
+ metadata, for example a timestamp, a severity level, a type, and other
18
+ optional metadata fields.
19
19
* xref:notification_matchers[Notification Matchers] route a notification
20
- event to one or more notification targets. A matcher can have match
21
- rules to selectively route based on the metadata of a notification event.
20
+ event to one or more notification targets. A matcher can have match rules to
21
+ selectively route based on the metadata of a notification event.
22
22
* xref:notification_targets[Notification Targets] are a destination to
23
- which a notification event is routed to by a matcher.
24
- There are multiple types of target, mail-based (Sendmail and SMTP)
25
- and Gotify.
23
+ which a notification event is routed to by a matcher. There are multiple
24
+ types of target, mail-based (Sendmail and SMTP) and Gotify.
26
25
27
26
Backup jobs have a configurable xref:notification_mode[Notification Mode].
28
- It allows you to choose between the notification system and a legacy mode
29
- for sending notification emails. The legacy mode is equivalent to the
30
- way notifications were handled before {pve} 8.1.
27
+ It allows you to choose between the notification system and a legacy mode for
28
+ sending notification emails. The legacy mode is equivalent to the way
29
+ notifications were handled before {pve} 8.1.
31
30
32
- The notification system can be configured in the GUI under
33
- Datacenter → Notifications. The configuration is stored in
34
- `/etc/pve/notifications.cfg` and `/etc/pve/priv/notifications.cfg` -
35
- the latter contains sensitive configuration options such as
36
- passwords or authentication tokens for notification targets and can
37
- only be read by `root` .
31
+ The notification system can be configured in the GUI under Datacenter →
32
+ Notifications. The configuration is stored in `/etc/pve/notifications.cfg` and
33
+ `/etc/pve/priv/notifications.cfg` - the latter contains sensitive configuration
34
+ options such as passwords or authentication tokens for notification targets and
35
+ can only be read by `root` .
38
36
39
37
[[notification_targets]]
40
38
Notification Targets
@@ -54,33 +52,32 @@ It is a command-line utility that allows users and applications to send emails
54
52
directly from the command line or from within scripts.
55
53
56
54
The sendmail notification target uses the `sendmail` binary to send emails to a
57
- list of configured users or email addresses. If a user is selected as a recipient,
58
- the email address configured in user's settings will be used.
55
+ list of configured users or email addresses. If a user is selected as a
56
+ recipient, the email address configured in user's settings will be used.
59
57
For the `root@pam` user, this is the email address entered during installation.
60
- A user's email address can be configured in
61
- `Datacenter → Permissions → Users` .
58
+ A user's email address can be configured in `Datacenter → Permissions → Users` .
62
59
If a user has no associated email address, no email will be sent.
63
60
64
61
NOTE: In standard {pve} installations, the `sendmail` binary is provided by
65
- Postfix. It may be necessary to configure Postfix so that it can deliver
66
- mails correctly - for example by setting an external mail relay (smart host).
67
- In case of failed delivery, check the system logs for messages logged by
68
- the Postfix daemon.
62
+ Postfix. It may be necessary to configure Postfix so that it can deliver mails
63
+ correctly - for example by setting an external mail relay (smart host). In case
64
+ of failed delivery, check the system logs for messages logged by the Postfix
65
+ daemon.
69
66
70
67
The configuration for Sendmail target plugins has the following options:
71
68
72
69
* `mailto` : E-Mail address to which the notification shall be sent to. Can be
73
- set multiple times to accommodate multiple recipients.
70
+ set multiple times to accommodate multiple recipients.
74
71
* `mailto-user` : Users to which emails shall be sent to. The user's email
75
- address will be looked up in `users.cfg` . Can be set multiple times to
76
- accommodate multiple recipients.
72
+ address will be looked up in `users.cfg` . Can be set multiple times to
73
+ accommodate multiple recipients.
77
74
* `author` : Sets the author of the E-Mail. Defaults to `Proxmox VE` .
78
75
* `from-address` : Sets the from address of the E-Mail. If the parameter is not
79
- set, the plugin will fall back to the `email_from` setting from
80
- `datacenter.cfg` . If that is also not set, the plugin will default to
81
- `root@$hostname` , where `$hostname` is the hostname of the node.
76
+ set, the plugin will fall back to the `email_from` setting from
77
+ `datacenter.cfg` . If that is also not set, the plugin will default to
78
+ `root@$hostname` , where `$hostname` is the hostname of the node.
79
+ The `From` header in the email will be set to `$author <$from-address>` .
82
80
* `comment` : Comment for this target
83
- The `From` header in the email will be set to `$author <$from-address>` .
84
81
85
82
Example configuration (`/etc/pve/notifications.cfg` ):
86
83
----
@@ -100,33 +97,33 @@ SMTP
100
97
101
98
SMTP notification targets can send emails directly to an SMTP mail relay.
102
99
This target does not use the system's MTA to deliver emails.
103
- Similar to sendmail targets, if a user is selected as a recipient, the user's configured
104
- email address will be used.
100
+ Similar to sendmail targets, if a user is selected as a recipient, the user's
101
+ configured email address will be used.
105
102
106
- NOTE: Unlike sendmail targets, SMTP targets do not have any queuing/retry mechanism
107
- in case of a failed mail delivery.
103
+ NOTE: Unlike sendmail targets, SMTP targets do not have any queuing/retry
104
+ mechanism in case of a failed mail delivery.
108
105
109
106
The configuration for SMTP target plugins has the following options:
110
107
111
108
* `mailto` : E-Mail address to which the notification shall be sent to. Can be
112
- set multiple times to accommodate multiple recipients.
109
+ set multiple times to accommodate multiple recipients.
113
110
* `mailto-user` : Users to which emails shall be sent to. The user's email
114
- address will be looked up in `users.cfg` . Can be set multiple times to
115
- accommodate multiple recipients.
111
+ address will be looked up in `users.cfg` . Can be set multiple times to
112
+ accommodate multiple recipients.
116
113
* `author` : Sets the author of the E-Mail. Defaults to `Proxmox VE` .
117
114
* `from-address` : Sets the From-address of the email. SMTP relays might require
118
- that this address is owned by the user in order to avoid spoofing.
119
- The `From` header in the email will be set to `$author <$from-address>` .
115
+ that this address is owned by the user in order to avoid spoofing. The `From`
116
+ header in the email will be set to `$author <$from-address>` .
120
117
* `username` : Username to use during authentication. If no username is set,
121
- no authentication will be performed. The PLAIN and LOGIN authentication methods
122
- are supported.
118
+ no authentication will be performed. The PLAIN and LOGIN authentication
119
+ methods are supported.
123
120
* `password` : Password to use when authenticating.
124
121
* `mode` : Sets the encryption mode (`insecure` , `starttls` or `tls` ). Defaults
125
- to `tls` .
126
- * `server` : Address/IP of the SMTP relay
127
- * `port` : The port to connect to. If not set, the used port
128
- defaults to 25 (`insecure` ), 465 (`tls` ) or 587 (`starttls` ), depending on the
129
- value of `mode` .
122
+ to `tls` .
123
+ * `server` : Address/IP of the SMTP relay.
124
+ * `port` : The port to connect to. If not set, the used port .
125
+ Defaults to 25 (`insecure` ), 465 (`tls` ) or 587 (`starttls` ), depending on
126
+ the value of `mode` .
130
127
* `comment` : Comment for this target
131
128
132
129
Example configuration (`/etc/pve/notifications.cfg` ):
@@ -164,11 +161,11 @@ The configuration for Gotify target plugins has the following options:
164
161
165
162
* `server` : The base URL of the Gotify server, e.g. `http://<ip>:8888`
166
163
* `token` : The authentication token. Tokens can be generated within the Gotify
167
- web interface.
164
+ web interface.
168
165
* `comment` : Comment for this target
169
166
170
167
NOTE: The Gotify target plugin will respect the HTTP proxy settings from the
171
- xref:datacenter_configuration_file[datacenter configuration]
168
+ xref:datacenter_configuration_file[datacenter configuration]
172
169
173
170
Example configuration (`/etc/pve/notifications.cfg` ):
174
171
----
@@ -280,22 +277,23 @@ For convenience, the following helpers are available:
280
277
[[notification_matchers]]
281
278
Notification Matchers
282
279
---------------------
280
+
283
281
[thumbnail="screenshot/gui-datacenter-notification-matcher.png"]
284
282
285
- Notification matchers route notifications to notification targets based
286
- on their matching rules. These rules can match certain properties of a
287
- notification, such as the timestamp (`match-calendar`), the severity of
288
- the notification (`match-severity`) or metadata fields (`match-field`).
283
+ Notification matchers route notifications to notification targets based on their
284
+ matching rules. These rules can match certain properties of a notification, such
285
+ as the timestamp (`match-calendar`), the severity of the notification
286
+ (`match-severity`) or metadata fields (`match-field`).
289
287
If a notification is matched by a matcher, all targets configured for the
290
288
matcher will receive the notification.
291
289
292
290
An arbitrary number of matchers can be created, each with with their own
293
291
matching rules and targets to notify.
294
- Every target is notified at most once for every notification, even if
295
- the target is used in multiple matchers.
292
+ Every target is notified at most once for every notification, even if the target
293
+ is used in multiple matchers.
296
294
297
- A matcher without any matching rules is always true; the configured targets
298
- will always be notified.
295
+ A matcher without any matching rules is always true; the configured targets will
296
+ always be notified.
299
297
----
300
298
matcher: always-matches
301
299
target admin
@@ -306,20 +304,22 @@ Matcher Options
306
304
~~~~~~~~~~~~~~~
307
305
308
306
* `target`: Determine which target should be notified if the matcher matches.
309
- can be used multiple times to notify multiple targets.
307
+ can be used multiple times to notify multiple targets.
310
308
* `invert-match`: Inverts the result of the whole matcher
311
309
* `mode`: Determines how the individual match rules are evaluated to compute
312
- the result for the whole matcher. If set to `all`, all matching rules must
313
- match. If set to `any`, at least one rule must match.
314
- a matcher must be true. Defaults to `all`.
315
- * `match-calendar`: Match the notification's timestamp against a schedule
316
- * `match-field`: Match the notification's metadata fields
317
- * `match-severity`: Match the notification's severity
318
- * `comment`: Comment for this matcher
310
+ the result for the whole matcher.
311
+ If set to `all`, all matching rules must match.
312
+ If set to `any`, at least one rule must match.
313
+ Defaults to `all`.
314
+ * `match-calendar`: Match the notification's timestamp against a schedule.
315
+ * `match-field`: Match the notification's metadata fields.
316
+ * `match-severity`: Match the notification's severity.
317
+ * `comment`: Comment for this matcher.
319
318
320
319
[[notification_matchers_calendar]]
321
320
Calendar Matching Rules
322
321
~~~~~~~~~~~~~~~~~~~~~~~
322
+
323
323
A calendar matcher matches the time when a notification is sent against a
324
324
configurable schedule.
325
325
@@ -331,9 +331,10 @@ configurable schedule.
331
331
[[notification_matchers_field]]
332
332
Field Matching Rules
333
333
~~~~~~~~~~~~~~~~~~~~
334
- Notifications have a selection of metadata fields that can be matched.
335
- When using `exact` as a matching mode, a `,` can be used as a separator.
336
- The matching rule then matches if the metadata field has *any* of the specified
334
+
335
+ Notifications have a selection of metadata fields that can be matched. When
336
+ using `exact` as a matching mode, a `,` can be used as a separator. The
337
+ matching rule then matches if the metadata field has *any* of the specified
337
338
values.
338
339
339
340
* `match-field exact:type=vzdump` Only match notifications about backups.
@@ -466,24 +467,23 @@ The `legacy-sendmail` mode might be removed in a later release of
466
467
Overriding Notification Templates
467
468
---------------------------------
468
469
469
- {pve} uses Handlebars templates to render notifications. The
470
- original templates provided by {pve} are stored in
471
- `/usr/share/pve-manager/templates/default/`.
470
+ {pve} uses Handlebars templates to render notifications. The original templates
471
+ provided by {pve} are stored in `/usr/share/pve-manager/templates/default/`.
472
472
473
- Notification templates can be overridden by providing a custom template
474
- file in the override directory at `/etc/pve/notification-templates/default/`.
475
- When rendering a notification of a given type, {pve} will first attempt
476
- to load a template from the override directory. If this one does not
477
- exist or fails to render, the original template will be used.
473
+ Notification templates can be overridden by providing a custom template file in
474
+ the override directory at `/etc/pve/notification-templates/default/`. When
475
+ rendering a notification of a given type, {pve} will first attempt to load a
476
+ template from the override directory. If this one does not exist or fails to
477
+ render, the original template will be used.
478
478
479
479
The template files follow the naming convention of
480
480
`<type>-<body|subject>.<html|txt>.hbs`. For instance, the file
481
- `vzdump-body.html.hbs` contains the template for rendering the HTML version
482
- for backup notifications, while `package-updates-subject.txt.hbs` is used to
483
- render the subject line of notifications for available package updates.
481
+ `vzdump-body.html.hbs` contains the template for rendering the HTML version for
482
+ backup notifications, while `package-updates-subject.txt.hbs` is used to render
483
+ the subject line of notifications for available package updates.
484
484
485
485
Email-based notification targets, such as `sendmail` and `smtp`, always send
486
- multi-part messages with an HTML and a plain text part. As a result, both
487
- the `<type>-body.html.hbs` as well as the `<type>-body.txt.hbs` template
488
- will be used when rendering the email message. All other notification
489
- target types only use the `<type>-body.txt.hbs` template.
486
+ multi-part messages with an HTML and a plain text part. As a result, both the
487
+ `<type>-body.html.hbs` as well as the `<type>-body.txt.hbs` template will be
488
+ used when rendering the email message. All other notification target types only
489
+ use the `<type>-body.txt.hbs` template.
0 commit comments