parent
6b9e988bbd
commit
6f38ba4501
@ -0,0 +1,25 @@
|
|||||||
|
global:
|
||||||
|
resolve_timeout: 5m
|
||||||
|
smtp_from: '18565885972@163.com'
|
||||||
|
smtp_smarthost: 'smtp.163.com:465'
|
||||||
|
smtp_auth_username: '18565885972@163.com'
|
||||||
|
smtp_auth_password: 'ZTASKEORBBNKWPRV'
|
||||||
|
smtp_require_tls: false
|
||||||
|
smtp_hello: 'xxx监控告警'
|
||||||
|
|
||||||
|
templates:
|
||||||
|
- '/etc/alertmanager/email.tmpl'
|
||||||
|
|
||||||
|
route:
|
||||||
|
group_by: ['alertname']
|
||||||
|
group_wait: 5s
|
||||||
|
group_interval: 5s
|
||||||
|
repeat_interval: 5m
|
||||||
|
receiver: 'email'
|
||||||
|
receivers:
|
||||||
|
- name: 'email'
|
||||||
|
email_configs:
|
||||||
|
- to: '2393740379@qq.com'
|
||||||
|
html: '{{ template "email.to.html" . }}'
|
||||||
|
headers: { Subject: "[WARN]告警" }
|
||||||
|
send_resolved: true
|
@ -0,0 +1,13 @@
|
|||||||
|
{{ define "email.to.html" }}
|
||||||
|
{{ range .Alerts }}
|
||||||
|
|
||||||
|
告警程序: prometheus_alert<br>
|
||||||
|
告警级别: {{ .Labels.severity }} 级<br>
|
||||||
|
告警类型: {{ .Labels.alertname }}<br>
|
||||||
|
故障主机: {{ .Labels.instance }}<br>
|
||||||
|
故障服务: {{ .Labels.job }}<br>
|
||||||
|
告警主题: {{ .Annotations.summary }}<br>
|
||||||
|
触发时间: {{ .StartsAt.Format "2020-01-02 15:04:05"}} <br>
|
||||||
|
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
@ -0,0 +1,11 @@
|
|||||||
|
groups:
|
||||||
|
- name: node_down
|
||||||
|
rules:
|
||||||
|
- alert: InstanceDown
|
||||||
|
expr: up == 0
|
||||||
|
for: 1m
|
||||||
|
labels:
|
||||||
|
user: test
|
||||||
|
annotations:
|
||||||
|
summary: "Instance {{ $labels.instance }} down"
|
||||||
|
description: "{{ $labels.instance }} of job {{ $labels.job }} has been down for more than 1 minutes."
|
Loading…
Reference in new issue