wechat.tmpl 820 B

1234567891011121314151617181920212223242526
  1. {{ define "wechat.default.message" }}
  2. {{ if gt (len .Alerts.Firing) 0 -}}
  3. Alerts Firing:
  4. {{ range .Alerts }}
  5. 告警级别:{{ .Labels.severity }}
  6. 告警类型:{{ .Labels.alertname }}
  7. 故障主机: {{ .Labels.instance }}
  8. 告警主题: {{ .Annotations.summary }}
  9. 告警详情: {{ .Annotations.description }}
  10. 触发时间: {{ .StartsAt.Format "2006-01-02 15:04:05" }}
  11. {{- end }}
  12. {{- end }}
  13. {{ if gt (len .Alerts.Resolved) 0 -}}
  14. Alerts Resolved:
  15. {{ range .Alerts }}
  16. 告警级别:{{ .Labels.severity }}
  17. 告警类型:{{ .Labels.alertname }}
  18. 故障主机: {{ .Labels.instance }}
  19. 告警主题: {{ .Annotations.summary }}
  20. 触发时间: {{ .StartsAt.Format "2006-01-02 15:04:05" }}
  21. 恢复时间: {{ .EndsAt.Format "2006-01-02 15:04:05" }}
  22. {{- end }}
  23. {{- end }}
  24. 告警链接:
  25. {{ template "__alertmanagerURL" . }}
  26. {{- end }}