This commit is contained in:
Sense T
2022-08-08 05:51:01 +00:00
commit 135a9dd01d
16 changed files with 213 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
bark_api: http://bark-server.default:8080/push
title:
firing: Homeserver 告警发生
resolved: Homeserver 告警解除
default: Homeserver
to:
- 'token'
template_file: text_template.tpl

View File

@@ -0,0 +1,22 @@
{%- for alert in alerts -%}
{%- if alert.status == 'firing' -%}
告警发生:
告警时间:{{alert.startsAt}}
{% if alert.labels.instance -%}涉及实例:{{alert.labels.instance}}{%- endif %}
{% if alert.labels.device -%}涉及设备:{{alert.labels.device}}{%- endif %}
告警名称:{{alert.labels.alertname}}
严重性:{{alert.labels.severity}}
详情:{{alert.annotations.summary}}
{% if alert.annotations.value -%}告警数据:{{alert.annotations.value}}{%- endif %}
{%- else -%}
告警恢复:
告警时间:{{alert.startsAt}}
恢复时间:{{alert.endsAt}}
{% if alert.labels.instance -%}涉及实例:{{alert.labels.instance}}{%- endif %}
{% if alert.labels.device -%}涉及设备:{{alert.labels.device}}{%- endif %}
告警名称:{{alert.labels.alertname}}
严重性:{{alert.labels.severity}}
详情:{{alert.annotations.summary}}
{% if alert.annotations.value -%}告警数据:{{alert.annotations.value}}{%- endif %}
{%- endif -%}
{%- endfor -%}