1 Media types

Overview

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

You can configure several media types:

Media types are configured in AdministrationMedia types.

1 Media types - 图1

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 for more details).

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

Common parameters

Some parameters are common for all media types.

1 Media types - 图2

In the Media type tab the common general attributes are:

ParameterDescription
NameName of the media type.
TypeSelect the type of media.
DescriptionEnter a description.
EnabledMark 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

  • Discovery

  • Autoregistration

  • Internal problem

  • Internal problem recovery

1 Media types - 图3

To customize message templates:

  • In the Message templates tab click on 1 Media types - 图4: 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

1 Media types - 图5

Message template parameters:

ParameterDescription
Message typeType of event for which default message will be defined.
Only one default message can be defined for each event type.
SubjectSubject of the default message. The subject may contain macros. It is limited to 255 characters.
Subject is not available for SMS media type.
MessageThe default message. The message may contain macros. It is limited to certain amount of characters depending on the type of database (see Sending messages for more information).

To make changes to an existing message template: In the Actions column click on 1 Media types - 图6 to edit the template or click on 1 Media types - 图7 to delete the message template.

A notification message template can also be defined for each action individually (see action operations for details). Custom messages in actions can override message templates configured for a media type.

Message templates must be defined for all media types, including webhooks or custom alert scripts that are not using default messages for notifications. For example, an action “Send message to Pushover webhook” will fail to send problem notifications, if problem message has not been defined for the Pushover webhook.

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 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.

1 Media types - 图8

ParameterDescription
Concurrent sessionsSelect 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.
AttemptsNumber of attempts for trying to send a notification. Up to 10 attempts can be specified; default value is ‘3’. If ‘1’ is specified Zabbix will send the notification only once and will not retry if the sending fails.
Attempt intervalFrequency of trying to resend a notification in case the sending failed, in seconds (0-60). If ‘0’ is specified, Zabbix will retry immediately.
Time suffixes are supported, e.g. 5s, 1m.

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 of media types

  • Click on Test in the last column of the list (a testing window will open)

  • Enter a recipient address in the Send to field and specify test notification subject (optional) and message.

  • Send a test message by clicking on Test

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

1 Media types - 图9

Webhook

To test a webhook media type:

  • Locate the relevant webhook in the list 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.

1 Media types - 图10

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

  • Click on Open log (a new popup window will open).
1 Media types - 图11
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

If the webhook test fails
  • “Media type test failed.” message is displayed, followed by additional failure details.

User media

User will receive media type notifications, only if a media (e-mail address / phone number / webhook user ID / etc) for this media type is defined in the user profile. For example, the action sending messages to user “Admin” using webhook “X” will always fail to send messages if webhook “X” media is not defined in the user profile.

To define user media:

  • Go to Administration → Users

  • Open the user properties form

  • In the Media tab, click on 1 Media types - 图12

User media attributes:

ParameterDescription
TypeThe drop-down list contains names of all configured media types.
Send toProvide required contact information where to send messages.

For an e-mail media type it is possible to add several addresses by clicking on 1 Media types - 图13 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 <[email protected]>’. 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 <[email protected]> and [email protected] are both valid formats. Incorrect examples: John Doe [email protected], “Zabbix\@\<H(comment)Q\>” <[email protected]> .
When activeYou can limit the time when messages are sent, for example, set the working days only (1-5,09:00-18:00).
See the Time period specification page for description of the format.
Use if severityMark 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.
StatusStatus of the user media.
Enabled - is in use.
Disabled - is not being used.