若要使用电子邮件作为消息发送的通道,那么您需要选择电子邮件作为媒介类型,同时为接收消息的用户指定具体的邮箱。
同一事件的多个通知会由相同的邮件线程处理。
将电子邮件配置为媒体类型:
媒体类型 选项卡包含一般媒体类型属性:
所有必填输入字段都标有红色星号。
以下参数特定于电子邮件媒体类型:
参数 | 说明 |
---|---|
SMTP 服务器 | 设置一个 SMTP 服务器来处理外发消息。 |
SMTP 服务器端口 | 设置 SMTP 服务器端口以处理传出消息。 从Zabbix 3.0开始支持此选项。 |
SMTP helo | 设置正确的 SMTP helo 值,通常是域名。 |
SMTP 电子邮件 | 此处输入的地址将用作发送邮件的发件人地址。 自 Zabbix 2.2 版本起,支持为发件人实际邮箱地址添加显示名称(如上述截图中 Zabbix_info <zabbix@ 中的“Zabbix_info” company.com>)。 与RFC 5322允许的相比,Zabbix 电子邮件中的显示名称有一些限制,如示例: 有效示例: [email protected](仅电子邮件地址,无需使用尖括号) Zabbix_info <[email protected]>(有显示名称并且使用尖括号包含邮箱地址) ∑Ω-monitoring <[email protected]>(显示名称中有使用UTF-8字符) 无效示例: Zabbix HQ zabbix@company。 com(有显示名称,但没有使用尖括号包含电子邮件地址) "Zabbix\@\<H(comment)Q\>" <[email protected]>(尽管RFC 5322有效 , 但Zabbix电子邮件中不支持括号和注释) |
连接安全 | 选择连接安全级别: 无 - 不使用 CURLOPT_USE_SSL 选项 STARTTLS - 使用带有 CURLUSSSL_ALL 值的 CURLOPT_USE_SSL 选项 SSL/TLS - CURLOPT_USE_SSL 的使用是可选的 从 Zabbix 3.0 开始支持该选项。 |
SSL verify peer | 勾选复选框以验证 SMTP 服务器的 SSL 证书。 “SSLCALocation”服务器配置指令的值应放入CURLOPT_CAPATH用于证书验证。 设置cURL选项,请参考CURLOPT_SSL_VERIFYPEER。 >从Zabbix 3.0开始支持该选项。 |
SSL verify host | 选中该复选框以验证 SMTP 服务器证书的 Common Name 字段或 Subject Alternate Name 字段是否匹配。 设置cURL选项,请参考CURLOPT_SSL_VERIFYHOST。 从 Zabbix 3.0 开始支持该选项。 |
身份验证 | 选择身份验证级别: 无 - 未设置 cURL 选项 (自3.4.2版本起)用户名和密码 - 验证机制由cURL完成而非 "AUTH=*" (直到3.4.2版本)普通密码 - CURLOPT_LOGIN_OPTIONS参数设置为“AUTH=PLAIN” 从Zabbix 3.0开始支持该选项。 |
用户名 | 用于身份验证的用户名。 设置CURLOPT_USERNAME参数的值。 从Zabbix 3.0开始支持该选项。 |
密码 | 用于身份验证的密码。 设置 CURLOPT_PASSWORD参数的值。 从Zabbix 3.0开始支持该选项。 |
消息格式 | 选择消息格式: HTML - 以HTML格式发送 纯文本 - 以纯文本格式发送 |
要使 SMTP 身份验证选项可用,Zabbix server编译时添加--with-libcurl选项(编译),cURL要求7.20.0 及以上版本。
有关如何配置默认消息和告警处理选项的详细信息,另请参阅通用媒体类型参数。
The following parameters are required for retrieving OAuth tokens:
Parameter | Description |
---|---|
Redirection endpoint | Enter Zabbix frontend URL where the OAuth service will redirect back the OAuth authorization (using format https://<zabbix-frontend-url>/zabbix.php?action=oauth.authorize ).It is set automatically for a new email media type when the frontend URL is defined. |
Client ID | Enter unique identifier of the client app registered within the OAuth authorization server. |
Client secret | Enter private secret of the client app registered within the OAuth authorization server. |
Authorization endpoint | Enter the OAuth authorization server URL for requesting user authorization. |
Authorization parameters | Enter parameters for the authorization endpoint. |
Authorization code | Enter the authorization code: Automatic - the code will be retrieved automatically through a redirection page Manual - enter the code manually if automatic retrieval fails |
Token endpoint | Enter the OAuth authorization server URL to exchange the authorization code for access and refresh tokens. |
Token parameters | Enter parameters for the access token. |
The retrieval of OAuth tokens has automated features for Gmail, Gmail relay and Office365 email providers. It is only required to supply Redirection endpoint, Client ID and Client secret parameter values. Zabbix will automatically fill the other required values (see OAuth URL defaults by provider).
After submitting OAuth parameters:
A browser popup is opened navigating user to the Authorization endpoint.
User authorizes Zabbix in the OAuth service.
The OAuth service redirects user to the Zabbix frontend action oauth.authorize
with the authorization code and scope value.
In response, Zabbix will make a request to Token endpoint to exchange the authorization code for access and refresh tokens.
要测试已配置的电子邮件媒体类型是否正常工作:
测试成功或失败消息将显示在同一窗口中:
当完成电子邮件媒介类型的配置,请前往 用户 → 用户 配置栏,对用户属性中的电子邮件媒介进行配置。 用户媒介的设定步骤, 该设定适用于所有媒介类型, 请参考 媒介类型 页面。