通过 Slack 接收告警
Last updated
Last updated
ALERT InstanceStatus
IF up {job="node"}== 0
FOR 15s
LABELS {
instance = "",
}
ANNOTATIONS {
summary = "服务器运行状态",
description = 服务器已当机超过多少时间",
link="http://xxx",
color="#xxx",
username="@sjy"
}- alert: InstanceStatus
expr: up {job="node"} == 0
for: 15s
labels:
instance: ""
annotations:
summary: "服务器运行状态"
description: 服务器已当机超过多少时间"
link: "http://xxx"
color: "#xxx"
username: "@sjy"receivers:
- name: 'slack'
slack_configs:
- api_url: "xxx"
channel: "#test"
text: "{{ range .Alerts }} {{ .Annotations.description}}\n {{end}} {{ .CommonAnnotations.username}} <{{.CommonAnnotations.link}}| click here>"
title: "{{.CommonAnnotations.summary}}"
title_link: "{{.CommonAnnotations.link}}"
color: "{{.CommonAnnotations.color}}"