[comment]: # translation:outdated

[comment]: # ({new-e88c898d})
# 1 Media types

[comment]: # ({/new-e88c898d})

[comment]: # ({new-3c7a0fa2})
#### Overview

Media are the delivery channels used for sending notifications and
alerts from Zabbix.

You can configure several media types:

-   [E-mail](/manual/config/notifications/media/email)
-   [SMS](/manual/config/notifications/media/sms)
-   [Custom alertscripts](/manual/config/notifications/media/script)
-   [Webhook](/manual/config/notifications/media/webhook)

Media types are configured in *Administration* → *Media types*.

![](../../../../assets/en/manual/config/notifications/media_type_list.png){width="600"}

Some media types come pre-defined in the default dataset. You just need
to finetune their parameters to get them working.

It is possible to test if a configured media type works, by clicking on
*Test* in the last column (see [Media type testing](#media_type_testing)
for more details).

To create a new media type, click on the *Create media type* button. A
media type configuration form is opened.

[comment]: # ({/new-3c7a0fa2})

[comment]: # ({new-ec50bee8})
#### Common parameters

Some parameters are common for all media types.

![](../../../../assets/en/manual/config/notifications/media_types_common.png)

In the **Media type** tab the common general attributes are:

|Parameter|Description|
|---------|-----------|
|*Name*|Name of the media type.|
|*Type*|Select the type of media.|
|*Description*|Enter a description.|
|*Enabled*|Mark the checkbox to enable the media type.|

See the individual pages of media types for media-specific parameters.

The **Message templates** tab allows to set default notification
messages for all or some of the following event types:

-   Problem
-   Problem recovery
-   Problem update
-   Service
-   Service recovery
-   Service update
-   Discovery
-   Autoregistration
-   Internal problem
-   Internal problem recovery

![](../../../../assets/en/manual/config/notifications/media_type_messages.png)

To customize message templates:

-   In the *Message templates* tab click on
    ![](../../../../assets/en/manual/config/add_link.png): a *Message
    template* popup window will open.
-   Select required *Message type* and edit *Subject* and *Message*
    texts.
-   Click on *Add* to save the message template

![](../../../../assets/en/manual/config/notifications/media/media_types2.png)

Message template parameters:

|Parameter|<|<|<|<|Description|
|---------|-|-|-|-|-----------|
|*Message type*|<|<|<|<|Type of an event for which the default message should be used.<br>Only one default message can be defined for each event type.<br>|
|*Subject*|<|<|<|<|Subject of the default message. The subject may contain macros. It is limited to 255 characters.<br>Subject is not available for SMS media type.|
|*Message*|<|<|<|<|The default message. It is limited to certain amount of characters depending on the database type (see [Sending messages](/manual/config/notifications/action/operation/message/) for more information).<br>The message may contain supported [macros](/manual/appendix/macros/supported_by_location).<br>In problem and problem update messages, expression macros are supported (for example, `{?avg(/host/key,1h)}`).|

To make changes to an existing message template: In the *Actions* column
click on ![](../../../../assets/en/manual/config/edit_link.png) to edit
the template or click on
![](../../../../assets/en/manual/config/remove_link.png) to delete the
message template.

It is possible to define a custom message template for a specific action
(see [action
operations](/manual/config/notifications/action/operation#operation_details)
for details). Custom messages defined in the action configuration will
override default media type message template.

::: notewarning
 Defining message templates is mandatory for all
media types, including webhooks or custom alert scripts that do not use
default messages for notifications. For example, an action "Send message
to Pushover webhook" will fail to send problem notifications, if the
Problem message for the Pushover webhook is not defined. 
:::

The **Options** tab contains alert processing settings. The same set of
options is configurable for each media type.

All media types are processed in parallel. While the maximum number of
concurrent sessions is configurable per media type, the total number of
alerter processes on the server can only be limited by the StartAlerters
[parameter](/manual/appendix/config/zabbix_server). Alerts generated by
one trigger are processed sequentially. So multiple notifications may be
processed simultaneously only if they are generated by multiple
triggers.

![](../../../../assets/en/manual/config/notifications/media/media_type_options.png)

|Parameter|Description|
|---------|-----------|
|*Concurrent sessions*|Select the number of parallel alerter sessions for the media type:<br>**One** - one session<br>**Unlimited** - unlimited number of sessions<br>**Custom** - select a custom number of sessions<br>Unlimited/high values mean more parallel sessions and increased capacity for sending notifications. Unlimited/high values should be used in large environments where lots of notifications may need to be sent simultaneously.<br>If more notifications need to be sent than there are concurrent sessions, the remaining notifications will be queued; they will not be lost.|
|*Attempts*|Number of attempts for trying to send a notification. Up to 100 attempts can be specified; the default value is '3'. If '1' is specified Zabbix will send the notification only once and will not retry if the sending fails.|
|*Attempt interval*|Frequency of trying to resend a notification in case the sending failed, in seconds (0-3600). If '0' is specified, Zabbix will retry immediately.<br>Time suffixes are supported, e.g. 5s, 3m, 1h.|

[comment]: # ({/new-ec50bee8})

[comment]: # ({new-f853cf99})
#### Media type testing

It is possible to test if a configured media type works.

**E-mail**

For example, to test an e-mail media type:

-   Locate the relevant e-mail in the [list](#overview) of media types
-   Click on *Test* in the last column of the list (a testing window
    will open)
-   Enter a *Send to* recipient address and with body and optional
    subject
-   Send a test message by clicking on *Test*

Test success or failure message will be displayed in the same window:

|<|![](../../../../assets/en/manual/config/notifications/media/test_email0.png){width="600"}|
|-|-----------------------------------------------------------------------------------------|

\*\*Webhook \*\*

To test a webhook media type:

-   Locate the relevant webhook in the [list](#overview) of media types
-   Click on *Test* in the last column of the list (a testing window
    will open)
-   Edit the webhook parameter values, if needed
-   Click on *Test*

By default, webhook tests are performed with parameters entered during
configuration. However, it is possible to change attribute values for
testing. Replacing or deleting values in the testing window affects the
test procedure only, the actual webhook attribute values will remain
unchanged.

|<|![](../../../../assets/en/manual/config/webhook_test1.png){width="600"}|
|-|-----------------------------------------------------------------------|

To view media type test log entries without leaving the test window:

-   Click on *Open log* (a new popup window will open).

|<|![](../../../../assets/en/manual/config/mediatype_test2.png){width="600"}|
|-|-------------------------------------------------------------------------|

[comment]: # ({/new-f853cf99})

[comment]: # ({new-fb922c6a})
##### If the webhook test is successful

-   *"Media type test successful."* message is displayed
-   Server response appears in the gray *Response* field
-   Response type (JSON or String) is specified below the *Response*
    field

[comment]: # ({/new-fb922c6a})

[comment]: # ({new-0ad268ee})
##### If the webhook test fails

-   *"Media type test failed."* message is displayed, followed by
    additional failure details.

[comment]: # ({/new-0ad268ee})

[comment]: # ({new-cb94600e})
#### User media

To receive notifications of a media type, a medium (e-mail address/phone
number/webhook user ID etc) for this media type must be defined in the
user profile. For example, an action sending messages to user "Admin"
using webhook "X" will always fail to send anything if the webhook "X"
medium is not defined in the user profile.

To define user media:

-   Go to your user profile, or go to *Administration → Users* and open
    the user properties form
-   In the Media tab, click on
    ![](../../../../assets/en/manual/config/add_link.png)

![](../../../../assets/en/manual/config/notifications/media/user_media2.png)

User media attributes:

|Parameter|Description|
|---------|-----------|
|*Type*|The drop-down list contains names of all configured media types.|
|*Send to*|Provide required contact information where to send messages.<br><br>For an e-mail media type it is possible to add several addresses by clicking on ![](../../../../assets/en/manual/config/add_link.png) below the address field. In this case, the notification will be sent to all e-mail addresses provided. It is also possible to specify recipient name in the *Send to* field of the e-mail recipient in a format 'Recipient name <address1\@company.com>'. Note, that if a recipient name is provided, an e-mail address should be wrapped in angle brackets (<>). UTF-8 characters in the name are supported, quoted pairs and comments are not. For example: *John Abercroft <manager\@nycdatacenter.com>* and *manager\@nycdatacenter.com* are both valid formats. Incorrect examples: *John Doe zabbix\@company.com*, *%%"Zabbix\\@\\<H(comment)Q\\>" <zabbix@company.com> %%*.|
|*When active*|You can limit the time when messages are sent, for example, set the working days only (1-5,09:00-18:00). Note that this limit is based on the user [time zone](/manual/web_interface/time_zone). If the user time zone is changed and is different from the system time zone this limit may need to be adjusted accordingly so as not to miss important messages.<br>See the [Time period specification](/manual/appendix/time_period) page for description of the format.|
|*Use if severity*|Mark the checkboxes of trigger severities that you want to receive notifications for.<br>*Note* that the default severity ('Not classified') **must be** checked if you want to receive notifications for non-trigger [events](/manual/config/events).<br>After saving, the selected trigger severities will be displayed in the corresponding severity colors, while unselected ones will be grayed out.|
|*Status*|Status of the user media.<br>**Enabled** - is in use.<br>**Disabled** - is not being used.|

[comment]: # ({/new-cb94600e})
