You are viewing documentation for the development version, it may be incomplete.
Join our translation project and help translate Zabbix documentation into your native language.

1 Media types

Overview

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

Media types support the following delivery methods:

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

To see how media types fit within the alerting process, let's look at the three requirements to deliver notifications from Zabbix to end users:

  1. An action operation must be defined that sends notifications
  2. A working media type must be defined (such as Email that send alerts using SMTP)
  3. User-level delivery details (such as e-mail addresses, phone numbers, etc) must be defined in user media
Media type testing

To test if a configured media type works, click on Test in the media type list.

The testing request will be sent to Zabbix server. Zabbix server will attempt to send an alert using the specified media type and will return the result to frontend. The frontend will wait for the server to return the results. Media type testing has a 65-second timeout by default (configurable in Administration > General > Timeouts).

See also testing details for:

Configuration

To create a media type in Zabbix frontend:

  • Go to: Alerts > Media types
  • Click on Create media type
  • Enter parameters of the media type in the form

Some parameters are common for all delivery methods.

Parameter Description
Name Name of the media type.
Type Select the delivery method for the media type.
Description Enter a description for the media type.
Enabled Mark the checkbox to enable the media type.

For method-specific parameters, see email, SMS, custom alertscript, or webhook pages.

Message templates

The Message templates tab contains default messages per event type (problem, problem recovery, discovery, etc).

Click on Add to define a default message (or Edit to update an existing message):

Parameter Description
Message type Type of an event for which the default message should be used.
Only one default message can be defined for each event type.
Subject Subject of the default message. The subject may contain macros. It is limited to 255 characters.
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 for more information).
The message may contain supported macros.
In problem and problem update messages, expression macros are supported (for example, {?avg(/host/key,1h)}).

Note that default messages are overridden by custom messages, if defined in action operations.

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

Options

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. Alerts generated by one trigger are processed sequentially. So multiple notifications may be processed simultaneously only if they are generated by multiple triggers.

Parameter Description
Concurrent sessions Select the number of parallel alerter sessions for the media type:
One - one session
Unlimited - unlimited number of sessions
Custom - select a custom number of sessions
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.
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.
Time suffixes are supported, e.g., 5s, 3m, 1h.

User media

While media types define how a notification will be sent, user media define where the notification must be sent.

User media (e.g. email address, webhook user ID, etc.) must be defined in the user profile regardless of the delivery method. An action sending messages to Admin user using webhook X will fail to deliver if the webhook X delivery details are not defined in the Admin user profile.

To define user media:

  • Go to Users > Users and open the user properties form (or go to User settings > Notifications of your own user profile)
  • Click on Add in the Media tab

Parameter Description
Type The drop-down list contains the names of enabled media types.
Note that when editing a medium of a disabled media type, the type will be displayed in red.
Send to Provide required contact information where to send messages.

For an email media type it is possible to add several addresses by clicking on below the address field. In this case, the notification will be sent to all email addresses provided. It is also possible to specify recipient name in the Send to field of the email recipient in a format 'Recipient name <[email protected]>'. Note that if a recipient name is provided, an email 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 <[email protected]> and [email protected] are both valid formats. Incorrect examples: John Doe [email protected], %%"Zabbix\@\<H(comment)Q\>" %%.
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. 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.
See the Time period specification page for description of the format.
User macros are supported.
Use if severity Mark the checkboxes of trigger severities that you want to receive notifications for.
Note that the default severity ('Not classified') must be checked if you want to receive notifications for non-trigger events.
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.
Enabled - is in use.
Disabled - is not being used.