# prometheus_alert_d_b

tpltype: dd
tpluse: Prometheus
tplname: prometheus-dd
created: 2022-05-26 10:00:05.9112314+00:00
tpl:
{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}
{{if eq $v.status "resolved"}}
## [Prometheus恢复信息]({{$v.generatorURL}})
#### [{{$v.labels.alertname}}]({{$var}})
###### 告警级别：{{$v.labels.level}}
###### 开始时间：{{TimeFormat $v.startsAt "2006-01-02 15:04:05"}}  
###### 结束时间：{{TimeFormat $v.endsAt "2006-01-02 15:04:05"}}  
###### 故障主机IP：{{$v.labels.instance}}
##### {{$v.annotations.description}}
![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)
{{else}}
## [Prometheus告警信息]({{$v.generatorURL}})
#### [{{$v.labels.alertname}}]({{$var}})
###### 告警级别：{{$v.labels.level}}
###### 开始时间：{{TimeFormat $v.startsAt "2006-01-02 15:04:05"}}  
###### 结束时间：{{TimeFormat $v.endsAt "2006-01-02 15:04:05"}} 
###### 故障主机IP：{{$v.labels.instance}}
##### {{$v.annotations.description}}
![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)
{{end}}
{{ end }}
{{ $urimsg:=""}}{{ range $key,$value:=.commonLabels }}{{$urimsg =  print $urimsg $key "%3D%22" $value "%22%2C" }}{{end}}[*** 点我屏蔽该告警]({{$var}}/#/silences/new?filter=%7B{{SplitString $urimsg 0 -3}}%7D)


tpltype: wx
tpluse: Prometheus
tplname: prometheus-wx
created: 2022-05-26 09:59:49.5966947+00:00
tpl:
{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}{{if eq $v.status "resolved"}}[PROMETHEUS-恢复信息]({{$v.generatorURL}})
> **[{{$v.labels.alertname}}]({{$var}})**
> <font color="info">告警级别:</font> {{$v.labels.level}}
> <font color="info">开始时间:</font> {{$v.startsAt}}
> <font color="info">结束时间:</font> {{$v.endsAt}}
> <font color="info">故障主机IP:</font> {{$v.labels.instance}}
> <font color="info">**{{$v.annotations.description}}**</font>{{else}}[PROMETHEUS-告警信息]({{$v.generatorURL}})
> **[{{$v.labels.alertname}}]({{$var}})**
> <font color="warning">告警级别:</font> {{$v.labels.level}}
> <font color="warning">开始时间:</font> {{$v.startsAt}}
> <font color="warning">结束时间:</font> {{$v.endsAt}}
> <font color="warning">故障主机IP:</font> {{$v.labels.instance}}
> <font color="warning">**{{$v.annotations.description}}**</font>{{end}}{{ end }}
{{ $urimsg:=""}}{{ range $key,$value:=.commonLabels }}{{$urimsg =  print $urimsg $key "%3D%22" $value "%22%2C" }}{{end}}[*** 点我屏蔽该告警]({{$var}}/#/silences/new?filter=%7B{{SplitString $urimsg 0 -3}}%7D)


tpltype: fs
tpluse: Prometheus
tplname: prometheus-fs
created: 2022-06-21 08:52:16.6315148+00:00
tpl:
{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}{{if eq $v.status "resolved"}}**[Prometheus恢复信息]({{$v.generatorURL}})**
*[{{$v.labels.alertname}}]({{$var}})*
告警级别：{{$v.labels.level}}
开始时间：{{TimeFormat $v.startsAt "2006-01-02 15:04:05"}}
结束时间：{{TimeFormat $v.endsAt "2006-01-02 15:04:05"}} 
故障主机IP：{{$v.labels.instance}}
**{{$v.annotations.description}}**{{else}}**[Prometheus告警信息]({{$v.generatorURL}})**
*[{{$v.labels.alertname}}]({{$var}})*
告警级别：{{$v.labels.level}}
开始时间：{{TimeFormat $v.startsAt "2006-01-02 15:04:05"}}
结束时间：{{TimeFormat $v.endsAt "2006-01-02 15:04:05"}}
故障主机IP：{{$v.labels.instance}}
**{{$v.annotations.description}}**{{end}}{{ end }}
{{ $urimsg:=""}}{{ range $key,$value:=.commonLabels }}{{$urimsg =  print $urimsg $key "%3D%22" $value "%22%2C" }}{{end}}[*** 点我屏蔽该告警]({{$var}}/#/silences/new?filter=%7B{{SplitString $urimsg 0 -3}}%7D)


tpltype: txdx
tpluse: Prometheus
tplname: prometheus-dx
created: 2021-09-24 08:44:36.9287136+00:00
tpl:
{{ range $k,$v:=.alerts }}{{if eq $v.status "resolved"}}
[Prometheus恢复信息]
{{$v.labels.alertname}}
告警级别：{{$v.labels.level}}
故障主机IP：{{$v.labels.instance}}
{{$v.annotations.description}}
{{else}}
[Prometheus告警信息]
{{$v.labels.alertname}}
告警级别：{{$v.labels.level}}
故障主机IP：{{$v.labels.instance}}
{{$v.annotations.description}}
{{end}}
{{ end }}


tpltype: txdh
tpluse: Prometheus
tplname: prometheus-dh
created: 2020-07-29 09:39:56.1351089+00:00
tpl:
{{ range $k,$v:=.alerts }}{{if eq $v.status "resolved"}}恢复信息故障主机IP{{$v.labels.instance}}{{$v.annotations.description}}{{else}}告警信息故障主机IP{{$v.labels.instance}}{{$v.annotations.description}}{{end}}{{ end }}


tpltype: email
tpluse: Prometheus
tplname: prometheus-email
created: 2020-09-30 09:46:05.59166+00:00
tpl:
{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}
{{if eq $v.status "resolved"}}
<h1><a href ={{$v.generatorURL}}>Prometheus恢复信息</a></h1>
<h2><a href ={{$var}}>{{$v.labels.alertname}}</a></h2>
<h5>告警级别：{{$v.labels.level}}</h5>
<h5>开始时间：{{$v.startsAt}}</h5>
<h5>结束时间：{{$v.endsAt}}</h5>
<h5>故障主机IP：{{$v.labels.instance}}</h5>
<h3>{{$v.annotations.description}}</h3>
<img src=https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png />
{{else}}
<h1><a href ={{$v.generatorURL}}>Prometheus告警信息</a></h1>
<h2><a href ={{$var}}>{{$v.labels.alertname}}</a></h2>
<h5>告警级别：{{$v.labels.level}}</h5>
<h5>开始时间：{{$v.startsAt}}</h5>
<h5>结束时间：{{$v.endsAt}}</h5>
<h5>故障主机IP：{{$v.labels.instance}}</h5>
<h3>{{$v.annotations.description}}</h3>
<img src=https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png />
{{end}}
{{ end }}


tpltype: dd
tpluse: Graylog2
tplname: graylog2-dd
created: 2020-07-29 09:45:33.3498487+00:00
tpl:
## [Graylog2告警信息](http://graylog.org)
#### {{.check_result.result_description}}
{{ range $k,$v:=.check_result.matching_messages }}
###### 告警索引：{{$v.index}}
###### 开始时间：{{GetCSTtime $v.timestamp}}
###### 告警主机：{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl2_remote_port}}
##### {{$v.message}}
{{end}}
![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)


tpltype: wx
tpluse: Graylog2
tplname: graylog2-wx
created: 2020-07-29 09:49:58.3266931+00:00
tpl:
[Graylog2告警信息](http://graylog.org)
>**{{.check_result.result_description}}**
{{ range $k,$v:=.check_result.matching_messages }}
>告警索引:{{$v.index}}
开始时间:{{GetCSTtime $v.timestamp}}
告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl2_remote_port}}
**{{$v.message}}**
{{end}}


tpltype: fs
tpluse: Graylog2
tplname: graylog2-fs
created: 2020-09-30 10:08:04.3732972+00:00
tpl:
**[Graylog2告警信息](http://graylog.org)**
*{{.check_result.result_description}}*
{{ range $k,$v:=.check_result.matching_messages }}
告警索引：{{$v.index}}
开始时间：{{GetCSTtime $v.timestamp}}
告警主机：{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl2_remote_port}}
**{{$v.message}}**
{{end}}


tpltype: txdx
tpluse: Graylog2
tplname: graylog2-dx
created: 2020-07-29 09:55:27.3273521+00:00
tpl:
{{ range $k,$v:=.check_result.matching_messages }}
告警主机 {{$v.fields.gl2_remote_ip}}端口 {{$v.fields.gl2_remote_port}}告警消息 {{$v.message}}
{{end}}


tpltype: email
tpluse: Graylog2
tplname: graylog2-email
created: 2020-07-29 09:59:08.2534663+00:00
tpl:
<h1><a href =http://graylog.org>Graylog2告警信息</a></h1>
<h2>{{.check_result.result_description}}</h2>
{{ range $k,$v:=.check_result.matching_messages }}
<h5>告警索引：{{$v.index}}</h5>
<h5>开始时间：{{GetCSTtime $v.timestamp}}</h5>
<h5>告警主机：{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl2_remote_port}}</h5>
<h3>{{$v.message}}</h3>
{{end}}
<img src=https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png />


tpltype: dd
tpluse: Graylog3
tplname: graylog3-dd
created: 2020-07-29 10:00:32.0648482+00:00
tpl:
## [Graylog3告警信息](.check_result.Event.Source)
#### {{.check_result.event_definition_description}}
{{ range $k,$v:=.backlog }}
###### 告警索引：{{$v.index}}
###### 开始时间：{{GetCSTtime $v.timestamp}}
###### 告警主机：{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl_2_remote_port}}
##### {{$v.message}}
{{end}}
![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)


tpltype: wx
tpluse: Graylog3
tplname: graylog3-wx
created: 2020-07-29 10:03:29.2436267+00:00
tpl:
[Graylog3告警信息](.check_result.Event.Source)
>**{{.check_result.event_definition_description}}**
{{ range $k,$v:=.backlog }}
>告警索引:{{$v.index}}
开始时间:{{GetCSTtime $v.timestamp}}
告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl_2_remote_port}}
**{{$v.message}}**
{{end}}


tpltype: fs
tpluse: Graylog3
tplname: graylog3-fs
created: 2020-09-30 09:52:11.7065592+00:00
tpl:
**[Graylog3告警信息](.check_result.Event.Source)**
*{{.check_result.event_definition_description}}*
{{ range $k,$v:=.backlog }}
告警索引：{{$v.index}}
开始时间：{{GetCSTtime $v.timestamp}}
告警主机：{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl_2_remote_port}}
**{{$v.message}}**
{{end}}


tpltype: txdx
tpluse: Graylog3
tplname: graylog3-dx
created: 2020-07-29 10:50:06.427498+00:00
tpl:
{{ range $k,$v:=.backlog }}
告警主机 {{$v.fields.gl2_remote_ip}}端口 {{$v.fields.gl_2_remote_port}}告警消息 {{$v.message}}
{{end}}


tpltype: email
tpluse: Graylog3
tplname: graylog3-email
created: 2020-07-29 10:53:20.5498706+00:00
tpl:
<h1><a href =.check_result.Event.Source>Graylog3告警信息</a></h1>
<h2>{{.check_result.event_definition_description}}</h2>
{{ range $k,$v:=.backlog }}
<h5>告警索引：{{$v.index}}</h5>
<h5>开始时间：{{GetCSTtime $v.timestamp}}</h5>
<h5>告警主机：{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl_2_remote_port}}</h5>
<h3>{{$v.message}}</h3>
{{end}}
<img src=https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png />


tpltype: dd
tpluse: Grafana
tplname: grafana-dd
created: 2020-07-29 11:40:33.5528424+00:00
tpl:
{{if eq .state "ok"}}
## [Grafana恢复信息]({{.ruleUrl}})
#### {{.ruleName}}
###### 告警级别：严重
###### 开始时间：{{GetCSTtime ""}}
##### {{.message}}
{{else}}
## [Grafana告警信息]({{.ruleUrl}})
#### {{.ruleName}}
###### 告警级别：严重
###### 开始时间：{{GetCSTtime ""}}
##### {{.message}}
{{end}}
![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)


tpltype: wx
tpluse: Grafana
tplname: grafana-wx
created: 2020-07-29 11:41:07.2160147+00:00
tpl:
{{if eq .state "ok"}}
[Grafana恢复信息]({{.ruleUrl}})
>**{{.ruleName}}**
>告警级别:严重
开始时间:{{GetCSTtime ""}}
{{.message}}
{{else}}
[Grafana告警信息]({{.ruleUrl}})
>**{{.ruleName}}**
>告警级别:严重
开始时间:{{GetCSTtime ""}}
{{.message}}
{{end}}


tpltype: fs
tpluse: Grafana
tplname: grafana-fs
created: 2020-09-30 09:53:04.178218+00:00
tpl:
{{if eq .state "ok"}}
**[Grafana恢复信息]({{.ruleUrl}})**
*{{.ruleName}}*
告警级别：严重
开始时间：{{GetCSTtime ""}}
**{{.message}}**
{{else}}
**[Grafana告警信息]({{.ruleUrl}})**
*{{.ruleName}}*
告警级别：严重
开始时间：{{GetCSTtime ""}}
**{{.message}}**
{{end}}


tpltype: email
tpluse: Grafana
tplname: grafana-email
created: 2020-07-29 11:52:25.141749+00:00
tpl:
{{if eq .state "ok"}}
<h1><a href ={{.ruleUrl}}>Grafana恢复信息</a></h1>
<h2>{{.ruleName}}</h2>
<h5>告警级别：严重</h5>
<h5>开始时间：{{GetCSTtime ""}}</h5>
<h3>{{.message}}</h3>
{{else}}
<h1><a href ={{.ruleUrl}}>Grafana恢复信息</a></h1>
<h2>{{.ruleName}}</h2>
<h5>告警级别：严重</h5>
<h5>开始时间：{{GetCSTtime ""}}</h5>
<h3>{{.message}}</h3>
{{end}}
<img src=https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png />


tpltype: dd
tpluse: SonarQube
tplname: sonar-dd-example
created: 2020-07-29 11:53:35.4294565+00:00
tpl:
## [Sonar告警信息]({{.serverUrl}})
###### 检测状态：{{.status}}
###### 检测时间：{{.analysedAt}}
###### ---------------------------------
{{ range $k,$v:=.qualityGate.conditions}}
###### metric：{{$v.metric}}
###### errorThreshold：{{$v.errorThreshold}}
###### operator：{{$v.operator}}
###### status：{{$v.status}}
###### -----------------------------------
{{ end }}
![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)


tpltype: dd
tpluse: Jenkins
tplname: jenkins-dd-example
created: 2020-07-29 11:54:02.2408626+00:00
tpl:
## [Jenkins构建信息]({{.buildUrl}})
###### Jenkins地址：[{{.buildUrl}}]({{.buildUrl}})
###### 构建项目：{{.projectName}}
###### 构建事件：{{.event}}
###### 构建名称：{{.buildName}}
###### 构建时间：{{GetCSTtime ""}}
![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)


tpltype: fs
tpluse: Prometheus
tplname: prometheus-fsv2
created: 2020-11-20 08:05:04.2774152+00:00
tpl:
{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}
{{if eq $v.status "resolved"}}
**[Prometheus恢复信息]({{$v.generatorURL}})**
*[{{$v.labels.alertname}}]({{$var}})*
告警级别：{{$v.labels.level}}
开始时间：{{$v.startsAt}}
结束时间：{{$v.endsAt}}
故障主机IP：{{$v.labels.instance}}
**{{$v.annotations.description}}**
{{else}}
**[Prometheus告警信息]({{$v.generatorURL}})**
*[{{$v.labels.alertname}}]({{$var}})*
告警级别：{{$v.labels.level}}
开始时间：{{$v.startsAt}}
结束时间：{{$v.endsAt}}
故障主机IP：{{$v.labels.instance}}
**{{$v.annotations.description}}**
{{end}}
{{ end }}


tpltype: workwechat
tpluse: Prometheus
tplname: prometheus-wechatapp
created: 2021-01-18 08:13:55.4321974+00:00
tpl:
{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}
{{if eq $v.status "resolved"}}
[Prometheus恢复信息]($v.generatorURL}})
>**[{{$v.labels.alertname}}]({{$var}})**
>告警级别: {{$v.labels.level}}
开始时间: {{$v.startsAt}}
结束时间: {{$v.endsAt}}
故障主机IP: {{$v.labels.instance}}
**{{$v.annotations.description}}**
{{else}}
[Prometheus告警信息]($v.generatorURL}})
>**[{{$v.labels.alertname}}]({{$var}})**
>告警级别: {{$v.labels.level}}
开始时间: {{$v.startsAt}}
结束时间: {{$v.endsAt}}
故障主机IP: {{$v.labels.instance}}
**{{$v.annotations.description}}**
{{end}}
{{ end }}


tpltype: rl
tpluse: Prometheus
tplname: prometheus-ruliu
created: 2021-02-02 07:45:30.4080271+00:00
tpl:
{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}
{{if eq $v.status "resolved"}}
## [Prometheus恢复信息]({{$v.generatorURL}})
#### [{{$v.labels.alertname}}]({{$var}})
###### 告警级别：{{$v.labels.level}}
###### 开始时间：{{$v.startsAt}}
###### 结束时间：{{$v.endsAt}}
###### 故障主机IP：{{$v.labels.instance}}
##### {{$v.annotations.description}}
![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)
{{else}}
## [Prometheus告警信息]({{$v.generatorURL}})
#### [{{$v.labels.alertname}}]({{$var}})
###### 告警级别：{{$v.labels.level}}
###### 开始时间：{{$v.startsAt}}
###### 结束时间：{{$v.endsAt}}
###### 故障主机IP：{{$v.labels.instance}}
##### {{$v.annotations.description}}
![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)
{{end}}
{{ end }}


tpltype: webhook
tpluse: WebHook
tplname: prometheus-webhook
created: 2021-04-29 08:04:12.6286475+00:00
tpl:
{
{{ $var := index .alerts 0}}
{{if eq $var.status "resolved"}}
"title": "Prometheus恢复信息",
"prometheus-url": "{{$var.generatorURL}}",
"alert-name": "{{$var.labels.alertname}}",
"alertmanager-url": "{{.externalURL}}",
"alert-level": "{{$var.labels.level}}",
"alert-start-time": "{{$var.startsAt}}",
"alert-end-time": "{{$var.endsAt}}",
"alert-instance": "{{$var.labels.instance}}",
"message": "{{$var.annotations.description}}"
{{else}}
"title": "Prometheus告警信息",
"prometheus-url": "{{$var.generatorURL}}",
"alert-name": "{{$var.labels.alertname}}",
"alertmanager-url": "{{.externalURL}}",
"alert-level": "{{$var.labels.level}}",
"alert-start-time": "{{$var.startsAt}}",
"alert-end-time": "{{$var.endsAt}}",
"alert-instance": "{{$var.labels.instance}}",
"message": "{{$var.annotations.description}}"
{{end}}
}


tpltype: wx
tpluse: ALiYun
tplname: aliyun
created: 2021-07-14 06:57:31.4160134+00:00
tpl:
ALiYun {{.AlertState}}信息
>**{{.AlertName}}**
>告警级别: {{.TriggerLevel}}
开始时间: {{GetTime .Timestamp}}
故障主机: {{.InstanceName}}
------------详细信息--------------
metricName: {{.MetricName}}
expression: {{.Expression}}
signature: {{.Signature}}
metricProject: {{.MetricProject}}
userId: {{.UserId}}
namespace: {{.Namespace}}
preTriggerLevel: {{.PreTriggerLevel}}
ruleId: {{.RuleId}}
dimensions: {{.Dimensions}}
**当前值：{{.CurValue}}**


tpltype: voice
tpluse: Prometheus
tplname: prometheus-voice
created: 2022-06-09 06:35:06.3244096+00:00
tpl:
{{ range $k,$v:=.alerts }}{{if eq $v.status "resolved"}}收到告警恢复信息：故障主机IP{{$v.labels.instance}}{{$v.annotations.description}}{{else}}收到告警信息：故障主机IP{{$v.labels.instance}}{{$v.annotations.description}}{{end}}{{ end }}


# alert_record

alertname: KubePodCrashLooping
alert_level: 3
instance: 172.28.58.250:8080
starts_at: 2019-12-06 10:57:50
ends_at: 0001-01-01 08:00:00
description: Pod CrashLooping,test-mars/emqx-test-0 的容器 emqx-test 10分钟重启了5次
alert_status: firing
created_time: 2022-06-21 08:27:25.2032588+00:00
updated_time: 2022-06-21 08:27:25.2032588+00:00
labels:
{"alertname":"KubePodCrashLooping","app":"kube-state-metrics","container":"emqx-test","instance":"172.28.58.250:8080","job":"kubernetes-service-endpoints","kubernetes_name":"kube-state-metrics","kubernetes_namespace":"monitor","level":"3","namespace":"test-mars","pod":"emqx-test-0"}


alertname: PodNotReady
alert_level: 2
instance: 172.28.58.250:8080
starts_at: 2019-12-06 10:12:17
ends_at: 0001-01-01 08:00:00
description: test-mars/emqx-test-0 was not ready more than 120s.
alert_status: firing
created_time: 2022-06-21 08:27:26.2402873+00:00
updated_time: 2022-06-21 08:27:26.2402873+00:00
labels:
{"alertname":"PodNotReady","app":"kube-state-metrics","class":"basic","container":"emqx-test","infrastructure":"true","instance":"172.28.58.250:8080","job":"kubernetes-service-endpoints","kubernetes_name":"kube-state-metrics","kubernetes_namespace":"monitor","level":"2","namespace":"test-mars","pod":"emqx-test-0"}


alertname: PodNotReady
alert_level: 4
instance: 172.28.58.250:8080
starts_at: 2019-12-06 10:15:17
ends_at: 0001-01-01 08:00:00
description: test-mars/emqx-test-0 was not ready more than 300s.
alert_status: firing
created_time: 2022-06-21 08:27:26.8481765+00:00
updated_time: 2022-06-21 08:27:26.8481765+00:00
labels:
{"alertname":"PodNotReady","app":"kube-state-metrics","class":"basic","container":"emqx-test","infrastructure":"true","instance":"172.28.58.250:8080","job":"kubernetes-service-endpoints","kubernetes_name":"kube-state-metrics","kubernetes_namespace":"monitor","level":"4","namespace":"test-mars","pod":"emqx-test-0"}


