第 21 章 事件通知

21.1. 在管理门户中配置事件通知

Red Hat Virtualization Manager 可以在 Red Hat Virtualization Manager 管理的环境中发生特定事件时,通过电子邮件通知指定用户。要使用这个功能,您必须设置邮件传输代理来发送邮件。只有电子邮件通知可以通过管理门户进行配置。SNMP 陷阱必须在 Manager 机器上配置。

配置事件通知

  1. 确保您有权访问电子邮件服务器,该服务器可接受来自 Manager 自动消息并将其传送到分发列表。
  2. AdministrationUsers 并选择一个用户。
  3. 点用户的 User Name 进入详情页面。
  4. Event Notifier 选项卡中,单击 Manage Events
  5. 使用 Expand All 按钮或特定主题的扩展按钮来查看事件。
  6. 选中适当的复选框。
  7. Mail Recipient 字段中输入电子邮件地址。

    注意

    电子邮件地址可以是文本消息电子邮件地址(例如 1234567890@carrierdomainname.com)或包含电子邮件地址和文本邮件电子邮件地址的电子邮件地址。

  8. 点击 OK
  9. 在 Manager 计算机上,将 ovirt-engine-notifier.conf 复制到名为 90-email-notify.conf 的新文件:

    # cp /usr/share/ovirt-engine/services/ovirt-engine-notifier/ovirt-engine-notifier.conf /etc/ovirt-engine/notifier/notifier.conf.d/90-email-notify.conf
  10. 编辑 90-email-notify.conf,删除所有除 EMAIL 通知 部分外的所有内容。
  11. 输入正确的电子邮件变量,如下例所示。此文件覆盖原始 ovirt-engine-notifier.conf 文件中的值。

    #---------------------#
    # EMAIL Notifications #
    #---------------------#
    
    # The SMTP mail server address. Required.
    MAIL_SERVER=myemailserver.example.com
    
    # The SMTP port (usually 25 for plain SMTP, 465 for SMTP with SSL, 587 for SMTP with TLS)
    MAIL_PORT=25
    
    # Required if SSL or TLS enabled to authenticate the user. Used also to specify 'from' user address if mail server
    # supports, when MAIL_FROM is not set. Address is in RFC822 format
    MAIL_USER=
    
    # Required to authenticate the user if mail server requires authentication or if SSL or TLS is enabled
    SENSITIVE_KEYS="${SENSITIVE_KEYS},MAIL_PASSWORD"
    MAIL_PASSWORD=
    
    # Indicates type of encryption (none, ssl or tls) should be used to communicate with mail server.
    MAIL_SMTP_ENCRYPTION=none
    
    # If set to true, sends a message in HTML format.
    HTML_MESSAGE_FORMAT=false
    
    # Specifies 'from' address on sent mail in RFC822 format, if supported by mail server.
    MAIL_FROM=rhevm2017@example.com
    
    # Specifies 'reply-to' address on sent mail in RFC822 format.
    MAIL_REPLY_TO=
    
    # Interval to send smtp messages per # of IDLE_INTERVAL
    MAIL_SEND_INTERVAL=1
    
    # Amount of times to attempt sending an email before failing.
    MAIL_RETRIES=4
    注意

    如需了解更多选项,请参阅 /etc/ovirt-engine/notifier/notifier.conf.d/README

  12. 启用并重启 ovirt-engine-notifier 服务以激活您所做的更改:

    # systemctl daemon-reload
    # systemctl enable ovirt-engine-notifier.service
    # systemctl restart ovirt-engine-notifier.service

指定用户现在根据 Red Hat Virtualization 环境中的事件接收电子邮件。所选事件显示在该用户的 Event Notifier 标签页中。