Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我如何告诉普罗米修斯';Alertmanager通过Gmail发送电子邮件';s SMTP服务器_Smtp_Gmail_Smtp Auth_Prometheus - Fatal编程技术网

我如何告诉普罗米修斯';Alertmanager通过Gmail发送电子邮件';s SMTP服务器

我如何告诉普罗米修斯';Alertmanager通过Gmail发送电子邮件';s SMTP服务器,smtp,gmail,smtp-auth,prometheus,Smtp,Gmail,Smtp Auth,Prometheus,我想普罗米修斯发送电子邮件从一个Gmail(Gapps)帐户时,指标超过某些阈值。 在中,没有提到密码。如何对SMTP服务器进行身份验证 这可以通过配置文件中的字段auth\u username、auth\u password和auth\u identity完成 网站上有完整的指南 确保您使用的是最新的alertmanager,0.1.1将不起作用。您可以在alert manager配置文件中使用以下模板,并根据需要更改值 config: global: resolve_timeou

我想普罗米修斯发送电子邮件从一个Gmail(Gapps)帐户时,指标超过某些阈值。
在中,没有提到密码。如何对SMTP服务器进行身份验证

这可以通过配置文件中的字段
auth\u username
auth\u password
auth\u identity
完成

网站上有完整的指南


确保您使用的是最新的alertmanager,0.1.1将不起作用。

您可以在alert manager配置文件中使用以下模板,并根据需要更改值

config:
  global:
    resolve_timeout: 5m
  route:
    group_by: ['job']
    group_wait: 30s
    group_interval: 5m
    repeat_interval: 1h
    receiver: 'tech-email'
    routes:
    - match:
        alertname: Watchdog
      receiver: 'null'
  receivers:
  - name: 'tech-email'
    email_configs:
    - to: 'to-email@example.com'
      from: 'from-email@outlook.com'
      auth_username: **********
      auth_password: **********
      require_tls: yes
      smarthost: **********
      send_resolved: true
  - name: 'null'

对于auth_用户名auth_密码smarthost,您可以从SES或任何提供商生成凭据。

我认为还需要一些其他东西。电子邮件通知仍然失败,错误为“必须首先发出STARTTLS命令”,以进一步澄清阅读此问题的任何人-在编写此问题时,普罗米修斯代码中存在一个错误,阻止电子邮件通知与TLS服务器一起工作。-在发表此评论时,有一个修复程序提交给github repo,但尚未发布包含该修复程序的版本。目前,必须从源代码构建Prometheus,以便在gmail(或另一个需要TLS的SMTP主机)上使用电子邮件警报。还要注意,配置的位置已更改,它现在位于配置文件中,而不是环境变量中。该指南已更新,但尚未发布。@brian Brazic是否认为2018年的配置仍然正确?@ipeacocks,是的,刚刚测试过,仍然有效。我想
注意
使用环境变量作为机密是违反最佳实践的,比如应用程序密码/令牌@brian brazil的编写将在编写配置时更改变量。