This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
manual:api:reference:mediatype:object [2017/06/07 10:55] gcalenko fixed attempt_iterval possible values definition (ZBXNEXT-2442) |
manual:api:reference:mediatype:object [2020/08/25 11:00] (current) martins-v internal link to data type commentary (ZBX-17160) |
||
---|---|---|---|
Line 7: | Line 7: | ||
The media type object has the following properties. | The media type object has the following properties. | ||
- | ^ Property ^ Type ^ Description ^ | + | ^ Property ^ [[:manual/api/reference_commentary#data_types|Type]] ^ Description ^ |
| mediatypeid | string | //(readonly)// ID of the media type. | | | mediatypeid | string | //(readonly)// ID of the media type. | | ||
- | | **description** \\ (required) | string | Name of the media type. | | + | | **name** \\ (required) | string | Name of the media type. | |
- | | **type** \\ (required) | integer | Transport used by the media type. \\ \\ Possible values: \\ 0 - e-mail; \\ 1 - script; \\ 2 - SMS; \\ 3 - Jabber; \\ 100 - Ez Texting. | | + | | **type** \\ (required) | integer | Transport used by the media type. \\ \\ Possible values: \\ 0 - email; \\ 1 - script; \\ 2 - SMS; \\ 4 - Webhook. | |
- | | exec_path | string | For script media types ''exec_path'' contains the name of the executed script. \\ \\ For Ez Texting ''exec_path'' contains the message text limit. \\ Possible text limit values: \\ 0 - USA (160 characters); \\ 1 - Canada (136 characters). \\ \\ Required for script and Ez Texting media types. | | + | | exec_path | string | For script media types ''exec_path'' contains the name of the executed script. \\ \\ Required for script media types. | |
| gsm_modem | string | Serial device name of the GSM modem. \\ \\ Required for SMS media types. | | | gsm_modem | string | Serial device name of the GSM modem. \\ \\ Required for SMS media types. | | ||
- | | passwd | string | Authentication password. \\ \\ Required for Jabber and Ez Texting media types. | | + | | passwd | string | Authentication password. \\ \\ Used for email media types. | |
| smtp_email | string | Email address from which notifications will be sent. \\ \\ Required for email media types. | | | smtp_email | string | Email address from which notifications will be sent. \\ \\ Required for email media types. | | ||
| smtp_helo | string | SMTP HELO. \\ \\ Required for email media types. | | | smtp_helo | string | SMTP HELO. \\ \\ Required for email media types. | | ||
| smtp_server | string | SMTP server. \\ \\ Required for email media types. | | | smtp_server | string | SMTP server. \\ \\ Required for email media types. | | ||
+ | | smtp_port | integer | SMTP server port to connect to. | | ||
+ | | smtp_security | integer | SMTP connection security level to use. \\ \\ Possible values: \\ 0 - None; \\ 1 - STARTTLS; \\ 2 - SSL/TLS. | | ||
+ | | smtp_verify_host | integer | SSL verify host for SMTP. \\ \\ Possible values: \\ 0 - No; \\ 1 - Yes. | | ||
+ | | smtp_verify_peer | integer | SSL verify peer for SMTP. \\ \\ Possible values: \\ 0 - No; \\ 1 - Yes. | | ||
+ | | smtp_authentication | integer | SMTP authentication method to use. \\ \\ Possible values: \\ 0 - None; \\ 1 - Normal password. | | ||
| status | integer | Whether the media type is enabled. \\ \\ Possible values: \\ 0 - //(default)// enabled; \\ 1 - disabled. | | | status | integer | Whether the media type is enabled. \\ \\ Possible values: \\ 0 - //(default)// enabled; \\ 1 - disabled. | | ||
- | | username | string | Username or Jabber identifier. \\ \\ Required for Jabber and Ez Texting media types. | | + | | username | string | User name. \\ \\ Used for email media types. | |
| exec_params | string | Script parameters. \\ \\ Each parameter ends with a new line feed. | | | exec_params | string | Script parameters. \\ \\ Each parameter ends with a new line feed. | | ||
| maxsessions | integer| The maximum number of alerts that can be processed in parallel. \\ \\ Possible values for SMS: \\ 1 - //(default)// \\ \\ Possible values for other media types: \\ 0-100 | | | maxsessions | integer| The maximum number of alerts that can be processed in parallel. \\ \\ Possible values for SMS: \\ 1 - //(default)// \\ \\ Possible values for other media types: \\ 0-100 | | ||
| maxattempts | integer | The maximum number of attempts to send an alert. \\ \\ Possible values: \\ 1-10 \\ \\ Default value: \\ 3| | | maxattempts | integer | The maximum number of attempts to send an alert. \\ \\ Possible values: \\ 1-10 \\ \\ Default value: \\ 3| | ||
- | | attempt_interval | string | The interval between retry attempts. Accepts seconds and time unit with suffix. \\ \\ Possible values: \\ 0s-60s \\ \\ Default value: \\ 10s| | + | | attempt_interval | string | The interval between retry attempts. Accepts seconds and time unit with suffix. \\ \\ Possible values: \\ 0-60s \\ \\ Default value: \\ 10s| |
+ | | content_type | integer | Message format. \\ \\ Possible values: \\ 0 - plain text; \\ 1 - //(default)// html. | | ||
+ | | script | string | Media type webhook script javascript body. | | ||
+ | | timeout | string | Media type webhook script timeout. Accepts seconds and time unit with suffix. \\ \\ Possible values: \\ 1-60s \\ \\ Default value: \\ 30s | | ||
+ | | process_tags | integer | Defines should the webhook script response to be interpreted as tags and these tags should be added to associated event. \\ \\ Possible values: \\ 0 - //(default)// Ignore webhook script response. \\ 1 - Process webhook script response as tags. | | ||
+ | | show_event_menu | integer | Show media type entry in ''problem.get'' and ''event.get'' property ''urls''. \\ \\ Possible values: \\ 0 - //(default)// Do not add ''urls'' entry. \\ 1 - Add media type to ''urls'' property. | | ||
+ | | event_menu_url | string | Define ''url'' property of media type entry in ''urls'' property of ''problem.get'' and ''event.get''. | | ||
+ | | event_menu_name | string | Define ''name'' property of media type entry in ''urls'' property of ''problem.get'' and ''event.get''. | | ||
+ | | parameters | array | Array of [[manual:api:reference:mediatype:object#Webhook parameters|webhook input parameters]]. | | ||
+ | | description | string | Media type description. | | ||
+ | |||
+ | ==== Webhook parameters ==== | ||
+ | |||
+ | Parameters passed to webhook script when it is called, have the following properties. | ||
+ | |||
+ | ^ Property ^ [[:manual/api/reference_commentary#data_types|Type]] ^ Description ^ | ||
+ | | **name** \\ (required) | string | Parameter name. | | ||
+ | | value | string | Parameter value, support macros. Supported macros described on [[manual:appendix:macros:supported_by_location|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 ^ [[:manual/api/reference_commentary#data_types|Type]] ^ Description ^ | ||
+ | | **eventsource** \\ (required) | integer | Event source. \\ \\ Possible values: \\ 0 - triggers; \\ 1 - discovery; \\ 2 - autoregistration; \\ 3 - internal. | | ||
+ | | **recovery** \\ (required) | integer | Operation mode. \\ \\ Possible values: \\ 0 - operations; \\ 1 - recovery operations; \\ 2 - update operations. | | ||
+ | | subject | string | Message subject. | | ||
+ | | message | string | Message text. | |