На странице
Объект способа оповещения
Следующие объекты непосредственно связаны с API mediatype.
Тип медиа
Объект типа медиа имеет следующие свойства.
| Property | Type | Description |
|---|---|---|
| mediatypeid | ID | ID типа медиа. Property behavior: - read-only - required for update operations |
| name | string | Имя типа медиа. Property behavior: - required for create operations |
| type | integer | Транспорт, используемый типом медиа. Possible values: 0 - Email; 1 - Script; 2 - SMS; 4 - Webhook. Property behavior: - required for create operations |
| exec_path | string | Имя файла скрипта (например, notification.sh), расположенного в каталоге, указанном в параметре конфигурации сервера AlertScriptsPath. Property behavior: - required if type is set to "Script" |
| gsm_modem | string | Имя последовательного устройства GSM-модема. Property behavior: - required if type is set to "SMS" |
| passwd | string | Пароль аутентификации. Property behavior: - supported if smtp_authentication is set to "Normal password" |
| provider | integer | Почтовый провайдер. Possible values: 0 - (default) Generic SMTP; 1 - Gmail; 2 - Gmail relay; 3 - Office365; 4 - Office365 relay. |
| smtp_email | string | Адрес электронной почты, с которого будут отправляться уведомления. 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-сервера для подключения. Default: 25. Property behavior: - supported if type is set to "Email" |
| smtp_security | integer | Уровень безопасности SMTP-подключения. Possible values: 0 - (default) None; 1 - STARTTLS; 2 - SSL/TLS. Property behavior: - supported if type is set to "Email" |
| smtp_verify_host | integer | Проверка SSL-хоста для 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-пира для 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-аутентификации. Possible values: 0 - (default) None; 1 - Normal password; 2 - OAuth token. OAuth authentication is not allowed for Office365 relay email provider. Property behavior: - supported if type is set to "Email" |
| redirection_url | string | URL веб-интерфейса Zabbix для возврата после авторизации OAuth. Default: Value of API settings property url with part zabbix.php?action=oauth.authorizeProperty behavior: - required if smtp_authentication is set to "OAuth token" |
| client_id | string | Идентификатор клиента, зарегистрированный на сервере авторизации OAuth. Property behavior: - required if smtp_authentication is set to "OAuth token" |
| client_secret | string | Секрет клиента, зарегистрированный на сервере авторизации OAuth. Доступен только пользователю типа Super Admin. Property behavior: - required if smtp_authentication is set to "OAuth token" |
| authorization_url | string | URL OAuth с параметрами для получения токенов доступа и обновления. Property behavior: - required if smtp_authentication is set to "OAuth token" |
| token_url | string | URL OAuth для обмена токена авторизации на токены доступа и обновления. Этот URL также используется сервером для обновления недействительного токена доступа. Property behavior: - required if smtp_authentication is set to "OAuth token" |
| tokens_status | integer | Битовая маска состояния токенов. Possible values: 0 - (default) Both tokens contain invalid value 1 - Access token contains valid value 2 - Refresh token contains valid value 3 - Both tokens contain valid value. Property behavior: - supported if smtp_authentication is set to "OAuth token" |
| access_token | string | Значение токена доступа OAuth. Property behavior: - required if smtp_authentication is set to "OAuth token" |
| access_token_updated | timestamp | Метка времени последнего изменения access_token, выполненного сервером при обновлении с помощью refresh_token или API при изменении токена.Property behavior: - supported if smtp_authentication is set to "OAuth token" |
| access_expires_in | integer | Время в секундах, через которое access_token станет устаревшим и потребуется выполнить запрос к refresh_url.Устанавливается сервером Zabbix при обновлении access_token или API при изменении токена.Метка времени вычисляется путем добавления значения access_token_updated.Property behavior: - supported if smtp_authentication is set to "OAuth token" |
| refresh_token | string | Значение токена обновления OAuth. Property behavior: - required if smtp_authentication is set to "OAuth token" |
| status | integer | Включен ли тип медиа. Possible values: 0 - (default) Enabled; 1 - Disabled. |
| username | string | Имя пользователя. Property behavior: - supported if smtp_authentication is set to "Normal password" |
| maxsessions | integer | Максимальное число оповещений, которые могут обрабатываться параллельно. 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 | Максимальное число попыток отправки оповещения. Possible values: 1-100. Default: 3. |
| attempt_interval | string | Интервал между повторными попытками. Accepts seconds and time unit with suffix. Possible values: 0-1h. Default: 10s. |
| message_format | integer | Формат сообщения. Possible values: 0 - Plain text; 1 - (default) HTML. Property behavior: - supported if type is set to "Email" |
| script | text | Тело скрипта вебхука (JavaScript). Property behavior: - required if type is set to "Webhook" |
| timeout | string | Тайм-аут скрипта вебхука. 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 | Обрабатывать значения свойств JSON в ответе скрипта вебхука как теги. Эти теги добавляются к любым существующим тегам проблемы. 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 | Добавлять пункт в меню событий, который ведет на пользовательский URL. Также добавляет свойство urls в результат problem.get и 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, используемый в пункте меню событий и в свойстве urls, возвращаемом problem.get и event.get.Property behavior: - supported if show_event_menu is set to "Include event menu entry and urls property" |
| event_menu_name | string | Имя, используемое в пункте меню событий и в свойстве urls, возвращаемом problem.get и event.get.Property behavior: - supported if show_event_menu is set to "Include event menu entry and urls property" |
| parameters | array | Параметры вебхука или скрипта. Property behavior: - supported if type is set to "Webhook" or "Script" |
| description | text | Описание типа медиа. |
Параметры вебхука
Параметры вебхука имеют следующие свойства.
| Property | Type | Description |
|---|---|---|
| name | string | Имя параметра. Поведение свойства: - required |
| value | string | Значение параметра, поддерживает макросы. Поддерживаемые макросы описаны на странице Поддерживаемые макросы. |
Параметры скрипта
Параметры скрипта имеют следующие свойства.
| Property | Type | Description |
|---|---|---|
| sortorder | integer | Порядок, в котором значения параметров будут передаваться скрипту как аргументы командной строки, начиная с 0 как первого. Property behavior: - required |
| value | string | Значение параметра, поддерживает макросы. Поддерживаемые макросы описаны на странице Supported macros. |
Шаблон сообщения
Объект шаблона сообщения определяет шаблон, который будет использоваться как сообщение по умолчанию для операций действия при отправке уведомления. Он имеет следующие свойства.
| Property | Type | Description |
|---|---|---|
| eventsource | integer | Источник события. Возможные значения: 0 - Триггеры; 1 - Обнаружение; 2 - Автоматическая регистрация; 3 - Внутренние; 4 - Сервисы. Поведение свойства: - required |
| recovery | integer | Режим операции. Возможные значения: 0 - Операции; 1 - Операции восстановления; 2 - Операции обновления. Поведение свойства: - required |
| subject | string | Тема сообщения. |
| message | string | Текст сообщения. |