Graylog: 配置邮件通知

本文档属于告警指南的一部分。您可以在此处查看完整指南:如何通过电子邮件、Slack 或 Mattermost 发送 Graylog 告警

👋 欢迎使用 Stackhero 文档!

Stackhero 提供即用型 Graylog 云 解决方案,具有众多优势,包括:

  • 包含无限制和专用的 SMTP 电子邮件服务器
  • 只需点击即可轻松完成更新
  • 使用 HTTPS 保护的可定制域名(例如,https://logs.your-company.com)。
  • 专用私有 VM提供的最佳性能和强大安全性

节省时间简化您的生活:只需 5 分钟即可试用 Stackhero 的 Graylog 云托管 解决方案!

Stackhero 提供的每个 Graylog 实例都内置了邮件服务器,允许您直接从实例发送无限量的邮件,无需额外费用。

要设置邮件通知,您可以按照以下步骤操作:

  1. 进入您的 Graylog 服务,导航至 Alerts > Notifications,点击 Get started! 按钮或选择 Create notification

  2. 输入通知标题,并在 Notification type 下选择 Email Notification

  3. Sender 字段中填写 noreply@<yourGraylogDomain>。请将 <yourGraylogDomain> 替换为您实际的 Graylog 域名,通常格式为 <XXXXXX>.stackhero-network.com

    重要提示: 请务必使用您的 Graylog 域名,以避免发送邮件时出现错误。

  4. Email recipient 字段中填写您希望接收告警的邮箱地址。

    邮件配置示例邮件配置示例

  5. 点击 Execute test notification 按钮,验证一切是否正常。确认无误后,点击 Create 完成设置。

恭喜!您的邮件通知现已配置完成并可正常使用!

如果您遇到 Error: Notification has email recipients and is triggered, but sending emails failed. Sending the email to the following server failed: postfix:25 错误,通常是因为 sender 字段格式不正确。它应遵循 <something>@<yourGraylogDomain> 的格式。something 可以自定义(如 "noreply"),但 yourGraylogDomain 必须与您的 Graylog 服务域名一致,通常为 <XXXXXX>.stackhero-network.com