init
This commit is contained in:
8
config/config_example.yaml
Normal file
8
config/config_example.yaml
Normal 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
|
22
config/text_template_example.tpl
Normal file
22
config/text_template_example.tpl
Normal 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 -%}
|
Reference in New Issue
Block a user