Áú»¢¶Ä²©

Media type object

The following objects are directly related to the mediatype API.

Media type

The media type object has the following properties.

Property Type Description
mediatypeid ID ID of the media type.

Property behavior:
- read-only
- required for update operations
name string Name of the media type.

Property behavior:
- required for create operations
type integer Transport used by the media type.

Possible values:
0 - Email;
1 - Script;
2 - SMS;
4 - Webhook.

Property behavior:
- required for create operations
exec_path string Name of the script file (e.g., notification.sh) that is located in the directory specified in the AlertScriptsPath server configuration parameter.

Property behavior:
- required if type is set to "Script"
gsm_modem string Serial device name of the GSM modem.

Property behavior:
- required if type is set to "SMS"
passwd string Authentication password.

Property behavior:
- supported if smtp_authentication is set to "Normal password"
provider integer Email provider.

Possible values:
0 - (default) Generic SMTP;
1 - Gmail;
2 - Gmail relay;
3 - Office365;
4 - Office365 relay.
smtp_email string Email address from which notifications will be sent.

Property behavior:
- required if type is set to "Email"
smtp_helo string SMTP HELO.

Property behavior:
- supported if type is set to "Email"
smtp_server string SMTP server.

Property behavior:
- required if type is set to "Email"
smtp_port integer SMTP server port to connect to.

Default: 25.

Property behavior:
- supported if type is set to "Email"
smtp_security integer SMTP connection security level to use.

Possible values:
0 - (default) None;
1 - STARTTLS;
2 - SSL/TLS.

Property behavior:
- supported if type is set to "Email"
smtp_verify_host integer SSL verify host for SMTP.

Possible values:
0 - (default) No;
1 - Yes.

Property behavior:
- supported if smtp_security is set to "STARTTLS" or "SSL/TLS"
smtp_verify_peer integer SSL verify peer for SMTP.

Possible values:
0 - (default) No;
1 - Yes.

Property behavior:
- supported if smtp_security is set to "STARTTLS" or "SSL/TLS"
smtp_authentication integer SMTP authentication method to use.

Possible values:
0 - (default) None;
1 - Normal password.

Property behavior:
- supported if type is set to "Email"
status integer Whether the media type is enabled.

Possible values:
0 - (default) Enabled;
1 - Disabled.
username string User name.

Property behavior:
- supported if smtp_authentication is set to "Normal password"
maxsessions integer The maximum number of alerts that can be processed in parallel.

Possible values if type is set to "SMS": 1.

Possible values if type is set to "Email", "Script", or "Webhook": 0-100.

Default: 1.
maxattempts integer The maximum number of attempts to send an alert.

Possible values: 1-100.

Default: 3.
attempt_interval string The interval between retry attempts.
Accepts seconds and time unit with suffix.

Possible values: 0-1h.

Default: 10s.
message_format integer Message format.

Possible values:
0 - Plain text;
1 - (default) HTML.

Property behavior:
- supported if type is set to "Email"
script text Webhook script body (JavaScript).

Property behavior:
- required if type is set to "Webhook"
timeout string Webhook script timeout.
Accepts seconds and time unit with suffix.

Possible values: 1-60s.

Default: 30s.

Property behavior:
- supported if type is set to "Webhook"
process_tags integer Process JSON property values in Webhook script response as tags. These tags are added to any existing problem tags.

Possible values:
0 - (default) Ignore webhook script response;
1 - Process webhook script response as tags.

Property behavior:
- supported if type is set to "Webhook"
show_event_menu integer Include an entry in the event menu that links to a custom URL. Also adds the urls property to the output of problem.get and event.get.

Possible values:
0 - (default) Do not include event menu entry or urls property;
1 - Include event menu entry and urls property.

Property behavior:
- supported if type is set to "Webhook"
event_menu_url string URL used in the event menu entry and in the urls property returned by problem.get and event.get.

Property behavior:
- supported if show_event_menu is set to "Include event menu entry and urls property"
event_menu_name string Name used for the event menu entry and in the urls property returned by problem.get and event.get.

Property behavior:
- supported if show_event_menu is set to "Include event menu entry and urls property"
parameters array Webhook or script parameters.

Property behavior:
- supported if type is set to "Webhook" or "Script"
description text Media type description.

Webhook parameters

Webhook parameters have the following properties.

Property Type Description
name string Parameter name.

Property behavior:
- required
value string Parameter value, supports macros.
Supported macros are described on the Supported macros page.

Script parameters

Script parameters have the following properties.

Property Type Description
sortorder integer The order in which parameter values will be passed to the script as command-line arguments, starting with 0 as the first one.

Property behavior:
- required
value string Parameter value, supports macros.
Supported macros are described on the Supported macros page.

Message template

The message template object defines a template that will be used as a default message for action operations to send a notification. It has the following properties.

Property Type Description
eventsource integer Event source.

Possible values:
0 - Triggers;
1 - Discovery;
2 - Autoregistration;
3 - Internal;
4 - Services.

Property behavior:
- required
recovery integer Operation mode.

Possible values:
0 - Operations;
1 - Recovery operations;
2 - Update operations.

Property behavior:
- required
subject string Message subject.
message string Message text.