prometheus-operator告警模塊alertmanager注意事項(QQ郵箱發送告警)--大大坑

在/stable/prometheus-operator/values.yaml配置告警郵件
  config:
    global:
      resolve_timeout: 5m
      smtp_smarthost: 'smtp.qq.com:465'
      smtp_from: 'xx@qq.com'
      smtp_auth_username: 'xx@qq.com'
      smtp_auth_password: 'xreqcqffrxtnieff'
      smtp_hello: '163.com'
      smtp_require_tls: false
    route:
      group_by: ['job','severity']
      group_wait: 30s
      group_interval: 1m
      repeat_interval: 1h
      receiver: default
      routes:
      - receiver: webhook
        match:
          alertname: TargetDown
    receivers:
    - name: default
      email_configs:
      - to: 'xx@pcidata.cn'
        send_resolved: true
    - name: webhook
      email_configs:
      - to: 'xx@pcidata.cn'
        send_resolved: true

 注意這裏有個天大的坑!!!!!html

1.smtp.qq.com:465 ,端口使用465。其餘資料說用587端口也能夠。(若是是雲服務器,25端口一般是被服務商封閉的(fk...),全部也不能使用25端口)web

 報錯信息:服務器

msg="Notify for alerts failed" num_alerts=1 err="*notify.loginAuth failed: 530 Must issue a STARTTLS command first."post

2.smtp_require_tls: false 必須加上,由於smtp_require_tls默認爲true。ui

3.須要先登陸QQ郵箱,開通smtp功能,並獲取受權碼。smtp_auth_password填寫的信息,就是受權碼,而非QQ郵箱的登陸密碼!(TM這個卡了我好幾天)spa

 

設置好以後就能夠愉快的發郵件啦。。。htm

 

 感謝: http://www.javashuo.com/article/p-foybjakc-eh.html
相關文章
相關標籤/搜索