diff --git a/controllers/prometheusalert.go b/controllers/prometheusalert.go index f9e7dada..25b0cd88 100644 --- a/controllers/prometheusalert.go +++ b/controllers/prometheusalert.go @@ -126,7 +126,7 @@ func (c *PrometheusAlertController) PrometheusAlert() { pMsg.Ddurl = checkURL(agMap["ddurl"], c.Input().Get("ddurl"), beego.AppConfig.String("ddurl")) pMsg.Wxurl = checkURL(agMap["wxurl"], c.Input().Get("wxurl"), beego.AppConfig.String("wxurl")) pMsg.Fsurl = checkURL(agMap["fsurl"], c.Input().Get("fsurl"), beego.AppConfig.String("fsurl")) - pMsg.Email = checkURL(agMap["email"], c.Input().Get("email"), beego.AppConfig.String("fsurl")) + pMsg.Email = checkURL(agMap["email"], c.Input().Get("email"), beego.AppConfig.String("email")) pMsg.GroupId = checkURL(agMap["groupid"], c.Input().Get("groupid"), beego.AppConfig.String("BDRL_ID")) pMsg.Phone = checkURL(agMap["phone"], c.Input().Get("phone")) diff --git a/db/PrometheusAlertDB.db b/db/PrometheusAlertDB.db index 8ac76575..520baf74 100644 Binary files a/db/PrometheusAlertDB.db and b/db/PrometheusAlertDB.db differ diff --git a/db/prometheus-alert-template.json b/db/prometheus-alert-template.json index ec67537f..35b1ea4f 100644 --- a/db/prometheus-alert-template.json +++ b/db/prometheus-alert-template.json @@ -1 +1 @@ -[{"Id":1,"Tpltype":"dd","Tpluse":"Prometheus","Tplname":"prometheus-dd","Tpl":"{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}\r\n{{if eq $v.status \"resolved\"}}\r\n## [Prometheus恢复信息]({{$v.generatorURL}})\r\n#### [{{$v.labels.alertname}}]({{$var}})\r\n###### 告警级别:{{$v.labels.level}}\r\n###### 开始时间:{{$v.startsAt}} \r\n###### 结束时间:{{$v.endsAt}} \r\n###### 故障主机IP:{{$v.labels.instance}}\r\n##### {{$v.annotations.description}}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)\r\n{{else}}\r\n## [Prometheus告警信息]({{$v.generatorURL}})\r\n#### [{{$v.labels.alertname}}]({{$var}})\r\n###### 告警级别:{{$v.labels.level}}\r\n###### 开始时间:{{$v.startsAt}} \r\n###### 故障主机IP:{{$v.labels.instance}}\r\n##### {{$v.annotations.description}}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)\r\n{{end}}\r\n{{ end }}\r\n{{ $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)","WebhookContentType":"","Created":"2022-08-23T11:16:44.2320871Z"},{"Id":2,"Tpltype":"wx","Tpluse":"Prometheus","Tplname":"prometheus-wx","Tpl":"{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}{{if eq $v.status \"resolved\"}}[PROMETHEUS-恢复信息]({{$v.generatorURL}})\r\n> **[{{$v.labels.alertname}}]({{$var}})**\r\n> 告警级别: {{$v.labels.level}}\r\n> 开始时间: {{$v.startsAt}}\r\n> 结束时间: {{$v.endsAt}}\r\n> 故障主机IP: {{$v.labels.instance}}\r\n> **{{$v.annotations.description}}**{{else}}[PROMETHEUS-告警信息]({{$v.generatorURL}})\r\n> **[{{$v.labels.alertname}}]({{$var}})**\r\n> 告警级别: {{$v.labels.level}}\r\n> 开始时间: {{$v.startsAt}}\r\n> 故障主机IP: {{$v.labels.instance}}\r\n> **{{$v.annotations.description}}**{{end}}{{ end }}\r\n{{ $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)","WebhookContentType":"","Created":"2022-08-23T11:17:00.1000254Z"},{"Id":3,"Tpltype":"fs","Tpluse":"Prometheus","Tplname":"prometheus-fs","Tpl":"{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}{{if eq $v.status \"resolved\"}}**[Prometheus恢复信息]({{$v.generatorURL}})**\r\n*[{{$v.labels.alertname}}]({{$var}})*\r\n告警级别:{{$v.labels.level}}\r\n开始时间:{{$v.startsAt}}\r\n结束时间:{{$v.endsAt}} \r\n故障主机IP:{{$v.labels.instance}}\r\n**{{$v.annotations.description}}**{{else}}**[Prometheus告警信息]({{$v.generatorURL}})**\r\n*[{{$v.labels.alertname}}]({{$var}})*\r\n告警级别:{{$v.labels.level}}\r\n开始时间:{{$v.startsAt}}\r\n故障主机IP:{{$v.labels.instance}}\r\n**{{$v.annotations.description}}**{{end}}{{ end }}\r\n{{ $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)","WebhookContentType":"","Created":"2022-08-23T11:17:35.5657855Z"},{"Id":4,"Tpltype":"txdx","Tpluse":"Prometheus","Tplname":"prometheus-dx","Tpl":"{{ range $k,$v:=.alerts }}{{if eq $v.status \"resolved\"}}\r\n[Prometheus恢复信息]\r\n{{$v.annotations.description}}\r\n{{else}}\r\n[Prometheus告警信息]\r\n{{$v.annotations.description}}\r\n{{end}}\r\n{{ end }}","WebhookContentType":"","Created":"2022-08-23T11:18:35.5041152Z"},{"Id":5,"Tpltype":"txdh","Tpluse":"Prometheus","Tplname":"prometheus-dh","Tpl":"{{ range $k,$v:=.alerts }}{{if eq $v.status \"resolved\"}}恢复信息{{$v.annotations.description}}{{else}}告警信息{{$v.annotations.description}}{{end}}{{ end }}","WebhookContentType":"","Created":"2022-08-23T11:19:03.9650279Z"},{"Id":6,"Tpltype":"email","Tpluse":"Prometheus","Tplname":"prometheus-email","Tpl":"{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}\r\n{{if eq $v.status \"resolved\"}}\r\n

Prometheus恢复信息

\r\n

{{$v.labels.alertname}}

\r\n
告警级别:{{$v.labels.level}}
\r\n
开始时间:{{$v.startsAt}}
\r\n
结束时间:{{$v.endsAt}}
\r\n
故障主机IP:{{$v.labels.instance}}
\r\n

{{$v.annotations.description}}

\r\n\r\n{{else}}\r\n

Prometheus告警信息

\r\n

{{$v.labels.alertname}}

\r\n
告警级别:{{$v.labels.level}}
\r\n
开始时间:{{$v.startsAt}}
\r\n
故障主机IP:{{$v.labels.instance}}
\r\n

{{$v.annotations.description}}

\r\n\r\n{{end}}\r\n{{ end }}","WebhookContentType":"","Created":"2022-08-23T11:19:18.1464147Z"},{"Id":7,"Tpltype":"dd","Tpluse":"Graylog2","Tplname":"graylog2-dd","Tpl":"## [Graylog2告警信息](http://graylog.org)\r\n#### {{.check_result.result_description}}\r\n{{ range $k,$v:=.check_result.matching_messages }}\r\n###### 告警索引:{{$v.index}}\r\n###### 开始时间:{{GetCSTtime $v.timestamp}}\r\n###### 告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl2_remote_port}}\r\n##### {{$v.message}}\r\n{{end}}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)","WebhookContentType":"","Created":"2020-07-29T09:45:33.3498487Z"},{"Id":8,"Tpltype":"wx","Tpluse":"Graylog2","Tplname":"graylog2-wx","Tpl":"[Graylog2告警信息](http://graylog.org)\r\n>**{{.check_result.result_description}}**\r\n{{ range $k,$v:=.check_result.matching_messages }}\r\n>告警索引:{{$v.index}}\r\n开始时间:{{GetCSTtime $v.timestamp}}\r\n告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl2_remote_port}}\r\n**{{$v.message}}**\r\n{{end}}","WebhookContentType":"","Created":"2020-07-29T09:49:58.3266931Z"},{"Id":9,"Tpltype":"fs","Tpluse":"Graylog2","Tplname":"graylog2-fs","Tpl":"**[Graylog2告警信息](http://graylog.org)**\r\n*{{.check_result.result_description}}*\r\n{{ range $k,$v:=.check_result.matching_messages }}\r\n告警索引:{{$v.index}}\r\n开始时间:{{GetCSTtime $v.timestamp}}\r\n告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl2_remote_port}}\r\n**{{$v.message}}**\r\n{{end}}","WebhookContentType":"","Created":"2020-09-30T10:08:04.3732972Z"},{"Id":10,"Tpltype":"txdx","Tpluse":"Graylog2","Tplname":"graylog2-dx","Tpl":"{{ range $k,$v:=.check_result.matching_messages }}告警信息 {{$v.message}}{{end}}","WebhookContentType":"","Created":"2022-08-23T11:19:57.6616658Z"},{"Id":20,"Tpltype":"txdh","Tpluse":"Graylog2","Tplname":"graylog2-dh","Tpl":"{{ range $k,$v:=.check_result.matching_messages }}告警信息 {{$v.message}}{{end}}","WebhookContentType":"","Created":"2022-08-23T11:20:26.7925827Z"},{"Id":27,"Tpltype":"email","Tpluse":"Graylog2","Tplname":"graylog2-email","Tpl":"

Graylog2告警信息

\r\n

{{.check_result.result_description}}

\r\n{{ range $k,$v:=.check_result.matching_messages }}\r\n
告警索引:{{$v.index}}
\r\n
开始时间:{{GetCSTtime $v.timestamp}}
\r\n
告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl2_remote_port}}
\r\n

{{$v.message}}

\r\n{{end}}\r\n","WebhookContentType":"","Created":"2020-07-29T09:59:08.2534663Z"},{"Id":28,"Tpltype":"dd","Tpluse":"Graylog3","Tplname":"graylog3-dd","Tpl":"## [Graylog3告警信息](.check_result.Event.Source)\r\n#### {{.check_result.event_definition_description}}\r\n{{ range $k,$v:=.backlog }}\r\n###### 告警索引:{{$v.index}}\r\n###### 开始时间:{{GetCSTtime $v.timestamp}}\r\n###### 告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl_2_remote_port}}\r\n##### {{$v.message}}\r\n{{end}}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)","WebhookContentType":"","Created":"2020-07-29T10:00:32.0648482Z"},{"Id":29,"Tpltype":"wx","Tpluse":"Graylog3","Tplname":"graylog3-wx","Tpl":"[Graylog3告警信息](.check_result.Event.Source)\r\n>**{{.check_result.event_definition_description}}**\r\n{{ range $k,$v:=.backlog }}\r\n>告警索引:{{$v.index}}\r\n开始时间:{{GetCSTtime $v.timestamp}}\r\n告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl_2_remote_port}}\r\n**{{$v.message}}**\r\n{{end}}","WebhookContentType":"","Created":"2020-07-29T10:03:29.2436267Z"},{"Id":30,"Tpltype":"fs","Tpluse":"Graylog3","Tplname":"graylog3-fs","Tpl":"**[Graylog3告警信息](.check_result.Event.Source)**\r\n*{{.check_result.event_definition_description}}*\r\n{{ range $k,$v:=.backlog }}\r\n告警索引:{{$v.index}}\r\n开始时间:{{GetCSTtime $v.timestamp}}\r\n告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl_2_remote_port}}\r\n**{{$v.message}}**\r\n{{end}}","WebhookContentType":"","Created":"2020-09-30T09:52:11.7065592Z"},{"Id":31,"Tpltype":"txdx","Tpluse":"Graylog3","Tplname":"graylog3-dx","Tpl":"{{ range $k,$v:=.backlog }}告警信息 {{$v.message}}{{end}}","WebhookContentType":"","Created":"2022-08-23T11:20:47.088395Z"},{"Id":32,"Tpltype":"txdh","Tpluse":"Graylog3","Tplname":"graylog3-dh","Tpl":"{{ range $k,$v:=.backlog }}告警信息 {{$v.message}}{{end}}","WebhookContentType":"","Created":"2022-08-23T11:21:01.5271001Z"},{"Id":33,"Tpltype":"email","Tpluse":"Graylog3","Tplname":"graylog3-email","Tpl":"

Graylog3告警信息

\r\n

{{.check_result.event_definition_description}}

\r\n{{ range $k,$v:=.backlog }}\r\n
告警索引:{{$v.index}}
\r\n
开始时间:{{GetCSTtime $v.timestamp}}
\r\n
告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl_2_remote_port}}
\r\n

{{$v.message}}

\r\n{{end}}\r\n","WebhookContentType":"","Created":"2020-07-29T10:53:20.5498706Z"},{"Id":34,"Tpltype":"dd","Tpluse":"Grafana","Tplname":"grafana-dd","Tpl":"{{if eq .state \"ok\"}}\r\n## [Grafana恢复信息]({{.ruleUrl}})\r\n#### {{.ruleName}}\r\n###### 告警级别:严重\r\n###### 开始时间:{{GetCSTtime \"\"}}\r\n##### {{.message}}\r\n{{else}}\r\n## [Grafana告警信息]({{.ruleUrl}})\r\n#### {{.ruleName}}\r\n###### 告警级别:严重\r\n###### 开始时间:{{GetCSTtime \"\"}}\r\n##### {{.message}}\r\n{{end}}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)","WebhookContentType":"","Created":"2020-07-29T11:40:33.5528424Z"},{"Id":35,"Tpltype":"wx","Tpluse":"Grafana","Tplname":"grafana-wx","Tpl":"{{if eq .state \"ok\"}}\r\n[Grafana恢复信息]({{.ruleUrl}})\r\n>**{{.ruleName}}**\r\n>告警级别:严重\r\n开始时间:{{GetCSTtime \"\"}}\r\n{{.message}}\r\n{{else}}\r\n[Grafana告警信息]({{.ruleUrl}})\r\n>**{{.ruleName}}**\r\n>告警级别:严重\r\n开始时间:{{GetCSTtime \"\"}}\r\n{{.message}}\r\n{{end}}","WebhookContentType":"","Created":"2020-07-29T11:41:07.2160147Z"},{"Id":36,"Tpltype":"fs","Tpluse":"Grafana","Tplname":"grafana-fs","Tpl":"{{if eq .state \"ok\"}}\r\n**[Grafana恢复信息]({{.ruleUrl}})**\r\n*{{.ruleName}}*\r\n告警级别:严重\r\n开始时间:{{GetCSTtime \"\"}}\r\n**{{.message}}**\r\n{{else}}\r\n**[Grafana告警信息]({{.ruleUrl}})**\r\n*{{.ruleName}}*\r\n告警级别:严重\r\n开始时间:{{GetCSTtime \"\"}}\r\n**{{.message}}**\r\n{{end}}","WebhookContentType":"","Created":"2020-09-30T09:53:04.178218Z"},{"Id":37,"Tpltype":"txdx","Tpluse":"Grafana","Tplname":"grafana-dx","Tpl":"{{if eq .state \"ok\"}}Grafana恢复信息{{.message}}{{else}}Grafana告警信息{{.message}}{{end}}","WebhookContentType":"","Created":"2022-08-23T11:21:21.1760057Z"},{"Id":38,"Tpltype":"txdh","Tpluse":"Grafana","Tplname":"grafana-dh","Tpl":"{{if eq .state \"ok\"}}Grafana恢复信息{{.message}}{{else}}Grafana告警信息{{.message}}{{end}}","WebhookContentType":"","Created":"2022-08-23T11:21:32.135424Z"},{"Id":39,"Tpltype":"email","Tpluse":"Grafana","Tplname":"grafana-email","Tpl":"{{if eq .state \"ok\"}}\r\n

Grafana恢复信息

\r\n

{{.ruleName}}

\r\n
告警级别:严重
\r\n
开始时间:{{GetCSTtime \"\"}}
\r\n

{{.message}}

\r\n{{else}}\r\n

Grafana恢复信息

\r\n

{{.ruleName}}

\r\n
告警级别:严重
\r\n
开始时间:{{GetCSTtime \"\"}}
\r\n

{{.message}}

\r\n{{end}}\r\n","WebhookContentType":"","Created":"2020-07-29T11:52:25.141749Z"},{"Id":40,"Tpltype":"dd","Tpluse":"SonarQube","Tplname":"sonar-dd-example","Tpl":"## [Sonar告警信息]({{.serverUrl}})\r\n###### 检测状态:{{.status}}\r\n###### 检测时间:{{.analysedAt}}\r\n###### ---------------------------------\r\n{{ range $k,$v:=.qualityGate.conditions}}\r\n###### metric:{{$v.metric}}\r\n###### errorThreshold:{{$v.errorThreshold}}\r\n###### operator:{{$v.operator}}\r\n###### status:{{$v.status}}\r\n###### -----------------------------------\r\n{{ end }}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)","WebhookContentType":"","Created":"2020-07-29T11:53:35.4294565Z"},{"Id":41,"Tpltype":"dd","Tpluse":"Jenkins","Tplname":"jenkins-dd-example","Tpl":"## [Jenkins构建信息]({{.buildUrl}})\r\n###### Jenkins地址:[{{.buildUrl}}]({{.buildUrl}})\r\n###### 构建项目:{{.projectName}}\r\n###### 构建事件:{{.event}}\r\n###### 构建名称:{{.buildName}}\r\n###### 构建时间:{{GetCSTtime \"\"}}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)","WebhookContentType":"","Created":"2020-07-29T11:54:02.2408626Z"},{"Id":42,"Tpltype":"fs","Tpluse":"Prometheus","Tplname":"prometheus-fsv2","Tpl":"{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}\r\n{{if eq $v.status \"resolved\"}}\r\n**[Prometheus恢复信息]({{$v.generatorURL}})**\r\n*[{{$v.labels.alertname}}]({{$var}})*\r\n告警级别:{{$v.labels.level}}\r\n开始时间:{{$v.startsAt}}\r\n结束时间:{{$v.endsAt}}\r\n故障主机IP:{{$v.labels.instance}}\r\n**{{$v.annotations.description}}**\r\n{{else}}\r\n**[Prometheus告警信息]({{$v.generatorURL}})**\r\n*[{{$v.labels.alertname}}]({{$var}})*\r\n告警级别:{{$v.labels.level}}\r\n开始时间:{{$v.startsAt}}\r\n结束时间:{{$v.endsAt}}\r\n故障主机IP:{{$v.labels.instance}}\r\n**{{$v.annotations.description}}**\r\n{{end}}\r\n{{ end }}","WebhookContentType":"","Created":"2020-11-20T08:05:04.2774152Z"},{"Id":43,"Tpltype":"workwechat","Tpluse":"Prometheus","Tplname":"prometheus-wechatapp","Tpl":"{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}\r\n{{if eq $v.status \"resolved\"}}\r\n[Prometheus恢复信息]($v.generatorURL}})\r\n>**[{{$v.labels.alertname}}]({{$var}})**\r\n>告警级别: {{$v.labels.level}}\r\n开始时间: {{$v.startsAt}}\r\n结束时间: {{$v.endsAt}}\r\n故障主机IP: {{$v.labels.instance}}\r\n**{{$v.annotations.description}}**\r\n{{else}}\r\n[Prometheus告警信息]($v.generatorURL}})\r\n>**[{{$v.labels.alertname}}]({{$var}})**\r\n>告警级别: {{$v.labels.level}}\r\n开始时间: {{$v.startsAt}}\r\n结束时间: {{$v.endsAt}}\r\n故障主机IP: {{$v.labels.instance}}\r\n**{{$v.annotations.description}}**\r\n{{end}}\r\n{{ end }}","WebhookContentType":"","Created":"2021-01-18T08:13:55.4321974Z"},{"Id":44,"Tpltype":"rl","Tpluse":"Prometheus","Tplname":"prometheus-ruliu","Tpl":"{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}\r\n{{if eq $v.status \"resolved\"}}\r\n## [Prometheus恢复信息]({{$v.generatorURL}})\r\n#### [{{$v.labels.alertname}}]({{$var}})\r\n###### 告警级别:{{$v.labels.level}}\r\n###### 开始时间:{{$v.startsAt}}\r\n###### 结束时间:{{$v.endsAt}}\r\n###### 故障主机IP:{{$v.labels.instance}}\r\n##### {{$v.annotations.description}}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)\r\n{{else}}\r\n## [Prometheus告警信息]({{$v.generatorURL}})\r\n#### [{{$v.labels.alertname}}]({{$var}})\r\n###### 告警级别:{{$v.labels.level}}\r\n###### 开始时间:{{$v.startsAt}}\r\n###### 结束时间:{{$v.endsAt}}\r\n###### 故障主机IP:{{$v.labels.instance}}\r\n##### {{$v.annotations.description}}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)\r\n{{end}}\r\n{{ end }}","WebhookContentType":"","Created":"2021-02-02T07:45:30.4080271Z"},{"Id":45,"Tpltype":"webhook","Tpluse":"WebHook","Tplname":"prometheus-webhook","Tpl":"{\r\n{{ $var := index .alerts 0}}\r\n{{if eq $var.status \"resolved\"}}\r\n\"title\": \"Prometheus恢复信息\",\r\n\"prometheus-url\": \"{{$var.generatorURL}}\",\r\n\"alert-name\": \"{{$var.labels.alertname}}\",\r\n\"alertmanager-url\": \"{{.externalURL}}\",\r\n\"alert-level\": \"{{$var.labels.level}}\",\r\n\"alert-start-time\": \"{{$var.startsAt}}\",\r\n\"alert-end-time\": \"{{$var.endsAt}}\",\r\n\"alert-instance\": \"{{$var.labels.instance}}\",\r\n\"message\": \"{{$var.annotations.description}}\"\r\n{{else}}\r\n\"title\": \"Prometheus告警信息\",\r\n\"prometheus-url\": \"{{$var.generatorURL}}\",\r\n\"alert-name\": \"{{$var.labels.alertname}}\",\r\n\"alertmanager-url\": \"{{.externalURL}}\",\r\n\"alert-level\": \"{{$var.labels.level}}\",\r\n\"alert-start-time\": \"{{$var.startsAt}}\",\r\n\"alert-end-time\": \"{{$var.endsAt}}\",\r\n\"alert-instance\": \"{{$var.labels.instance}}\",\r\n\"message\": \"{{$var.annotations.description}}\"\r\n{{end}}\r\n}","WebhookContentType":"","Created":"2021-04-29T08:04:12.6286475Z"},{"Id":46,"Tpltype":"wx","Tpluse":"ALiYun","Tplname":"aliyun","Tpl":"ALiYun {{.AlertState}}信息\r\n>**{{.AlertName}}**\r\n>告警级别: {{.TriggerLevel}}\r\n开始时间: {{GetTime .Timestamp}}\r\n故障主机: {{.InstanceName}}\r\n------------详细信息--------------\r\nmetricName: {{.MetricName}}\r\nexpression: {{.Expression}}\r\nsignature: {{.Signature}}\r\nmetricProject: {{.MetricProject}}\r\nuserId: {{.UserId}}\r\nnamespace: {{.Namespace}}\r\npreTriggerLevel: {{.PreTriggerLevel}}\r\nruleId: {{.RuleId}}\r\ndimensions: {{.Dimensions}}\r\n**当前值:{{.CurValue}}**","WebhookContentType":"","Created":"2021-07-14T06:57:31.4160134Z"},{"Id":47,"Tpltype":"voice","Tpluse":"Prometheus","Tplname":"prometheus-voice","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 }}","WebhookContentType":"","Created":"2022-06-09T06:35:06.3244096Z"},{"Id":48,"Tpltype":"fsapp","Tpluse":"Prometheus","Tplname":"prometheus-feishu-app","Tpl":"{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}{{if eq $v.status \"resolved\"}}**[Prometheus恢复信息]({{$v.generatorURL}})**\r\n*[{{$v.labels.alertname}}]({{$var}})*\r\n告警级别:{{$v.labels.level}}\r\n开始时间:{{$v.startsAt}}\r\n结束时间:{{$v.endsAt}} \r\n故障主机IP:{{$v.labels.instance}}\r\n**{{$v.annotations.description}}**{{else}}**[Prometheus告警信息]({{$v.generatorURL}})**\r\n*[{{$v.labels.alertname}}]({{$var}})*\r\n告警级别:{{$v.labels.level}}\r\n开始时间:{{$v.startsAt}}\r\n故障主机IP:{{$v.labels.instance}}\r\n**{{$v.annotations.description}}**{{end}}{{ end }}\r\n{{ $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)","WebhookContentType":"","Created":"2022-08-23T11:22:30.4313155Z"}] \ No newline at end of file +[{"Id":1,"Tpltype":"dd","Tpluse":"Prometheus","Tplname":"prometheus-dd","Tpl":"{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}\r\n{{if eq $v.status \"resolved\"}}\r\n## [Prometheus恢复信息]({{$v.generatorURL}})\r\n#### [{{$v.labels.alertname}}]({{$var}})\r\n###### 告警级别:{{$v.labels.level}}\r\n###### 开始时间:{{$v.startsAt}} \r\n###### 结束时间:{{$v.endsAt}} \r\n###### 故障主机IP:{{$v.labels.instance}}\r\n##### {{$v.annotations.description}}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)\r\n{{else}}\r\n## [Prometheus告警信息]({{$v.generatorURL}})\r\n#### [{{$v.labels.alertname}}]({{$var}})\r\n###### 告警级别:{{$v.labels.level}}\r\n###### 开始时间:{{$v.startsAt}} \r\n###### 故障主机IP:{{$v.labels.instance}}\r\n##### {{$v.annotations.description}}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)\r\n{{end}}\r\n{{ end }}\r\n{{ $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)","WebhookContentType":"","Created":"2022-08-23T11:16:44.2320871Z"},{"Id":2,"Tpltype":"wx","Tpluse":"Prometheus","Tplname":"prometheus-wx","Tpl":"{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}{{if eq $v.status \"resolved\"}}[PROMETHEUS-恢复信息]({{$v.generatorURL}})\r\n> **[{{$v.labels.alertname}}]({{$var}})**\r\n> 告警级别: {{$v.labels.level}}\r\n> 开始时间: {{$v.startsAt}}\r\n> 结束时间: {{$v.endsAt}}\r\n> 故障主机IP: {{$v.labels.instance}}\r\n> **{{$v.annotations.description}}**{{else}}[PROMETHEUS-告警信息]({{$v.generatorURL}})\r\n> **[{{$v.labels.alertname}}]({{$var}})**\r\n> 告警级别: {{$v.labels.level}}\r\n> 开始时间: {{$v.startsAt}}\r\n> 故障主机IP: {{$v.labels.instance}}\r\n> **{{$v.annotations.description}}**{{end}}{{ end }}\r\n{{ $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)","WebhookContentType":"","Created":"2022-08-23T11:17:00.1000254Z"},{"Id":3,"Tpltype":"fs","Tpluse":"Prometheus","Tplname":"prometheus-fs","Tpl":"{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}{{if eq $v.status \"resolved\"}}**[Prometheus恢复信息]({{$v.generatorURL}})**\r\n*[{{$v.labels.alertname}}]({{$var}})*\r\n告警级别:{{$v.labels.level}}\r\n开始时间:{{$v.startsAt}}\r\n结束时间:{{$v.endsAt}} \r\n故障主机IP:{{$v.labels.instance}}\r\n**{{$v.annotations.description}}**{{else}}**[Prometheus告警信息]({{$v.generatorURL}})**\r\n*[{{$v.labels.alertname}}]({{$var}})*\r\n告警级别:{{$v.labels.level}}\r\n开始时间:{{$v.startsAt}}\r\n故障主机IP:{{$v.labels.instance}}\r\n**{{$v.annotations.description}}**{{end}}{{ end }}\r\n{{ $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)","WebhookContentType":"","Created":"2022-08-23T11:17:35.5657855Z"},{"Id":4,"Tpltype":"txdx","Tpluse":"Prometheus","Tplname":"prometheus-dx","Tpl":"{{ range $k,$v:=.alerts }}{{if eq $v.status \"resolved\"}}\r\n[Prometheus恢复信息]\r\n{{$v.annotations.description}}\r\n{{else}}\r\n[Prometheus告警信息]\r\n{{$v.annotations.description}}\r\n{{end}}\r\n{{ end }}","WebhookContentType":"","Created":"2022-08-23T11:18:35.5041152Z"},{"Id":5,"Tpltype":"txdh","Tpluse":"Prometheus","Tplname":"prometheus-dh","Tpl":"{{ range $k,$v:=.alerts }}{{if eq $v.status \"resolved\"}}恢复信息{{$v.annotations.description}}{{else}}告警信息{{$v.annotations.description}}{{end}}{{ end }}","WebhookContentType":"","Created":"2022-08-23T11:19:03.9650279Z"},{"Id":6,"Tpltype":"email","Tpluse":"Prometheus","Tplname":"prometheus-email","Tpl":"{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}\r\n{{if eq $v.status \"resolved\"}}\r\n

Prometheus恢复信息

\r\n

{{$v.labels.alertname}}

\r\n
告警级别:{{$v.labels.level}}
\r\n
开始时间:{{$v.startsAt}}
\r\n
结束时间:{{$v.endsAt}}
\r\n
故障主机IP:{{$v.labels.instance}}
\r\n

{{$v.annotations.description}}

\r\n\r\n{{else}}\r\n

Prometheus告警信息

\r\n

{{$v.labels.alertname}}

\r\n
告警级别:{{$v.labels.level}}
\r\n
开始时间:{{$v.startsAt}}
\r\n
故障主机IP:{{$v.labels.instance}}
\r\n

{{$v.annotations.description}}

\r\n\r\n{{end}}\r\n{{ end }}","WebhookContentType":"","Created":"2022-08-23T11:19:18.1464147Z"},{"Id":7,"Tpltype":"dd","Tpluse":"Graylog2","Tplname":"graylog2-dd","Tpl":"## [Graylog2告警信息](http://graylog.org)\r\n#### {{.check_result.result_description}}\r\n{{ range $k,$v:=.check_result.matching_messages }}\r\n###### 告警索引:{{$v.index}}\r\n###### 开始时间:{{GetCSTtime $v.timestamp}}\r\n###### 告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl2_remote_port}}\r\n##### {{$v.message}}\r\n{{end}}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)","WebhookContentType":"","Created":"2020-07-29T09:45:33.3498487Z"},{"Id":8,"Tpltype":"wx","Tpluse":"Graylog2","Tplname":"graylog2-wx","Tpl":"[Graylog2告警信息](http://graylog.org)\r\n>**{{.check_result.result_description}}**\r\n{{ range $k,$v:=.check_result.matching_messages }}\r\n>告警索引:{{$v.index}}\r\n开始时间:{{GetCSTtime $v.timestamp}}\r\n告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl2_remote_port}}\r\n**{{$v.message}}**\r\n{{end}}","WebhookContentType":"","Created":"2020-07-29T09:49:58.3266931Z"},{"Id":9,"Tpltype":"fs","Tpluse":"Graylog2","Tplname":"graylog2-fs","Tpl":"**[Graylog2告警信息](http://graylog.org)**\r\n*{{.check_result.result_description}}*\r\n{{ range $k,$v:=.check_result.matching_messages }}\r\n告警索引:{{$v.index}}\r\n开始时间:{{GetCSTtime $v.timestamp}}\r\n告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl2_remote_port}}\r\n**{{$v.message}}**\r\n{{end}}","WebhookContentType":"","Created":"2020-09-30T10:08:04.3732972Z"},{"Id":10,"Tpltype":"txdx","Tpluse":"Graylog2","Tplname":"graylog2-dx","Tpl":"{{ range $k,$v:=.check_result.matching_messages }}告警信息 {{$v.message}}{{end}}","WebhookContentType":"","Created":"2022-08-23T11:19:57.6616658Z"},{"Id":20,"Tpltype":"txdh","Tpluse":"Graylog2","Tplname":"graylog2-dh","Tpl":"{{ range $k,$v:=.check_result.matching_messages }}告警信息 {{$v.message}}{{end}}","WebhookContentType":"","Created":"2022-08-23T11:20:26.7925827Z"},{"Id":27,"Tpltype":"email","Tpluse":"Graylog2","Tplname":"graylog2-email","Tpl":"

Graylog2告警信息

\r\n

{{.check_result.result_description}}

\r\n{{ range $k,$v:=.check_result.matching_messages }}\r\n
告警索引:{{$v.index}}
\r\n
开始时间:{{GetCSTtime $v.timestamp}}
\r\n
告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl2_remote_port}}
\r\n

{{$v.message}}

\r\n{{end}}\r\n","WebhookContentType":"","Created":"2020-07-29T09:59:08.2534663Z"},{"Id":28,"Tpltype":"dd","Tpluse":"Graylog3","Tplname":"graylog3-dd","Tpl":"## [Graylog3告警信息](.check_result.Event.Source)\r\n#### {{.check_result.event_definition_description}}\r\n{{ range $k,$v:=.backlog }}\r\n###### 告警索引:{{$v.index}}\r\n###### 开始时间:{{GetCSTtime $v.timestamp}}\r\n###### 告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl_2_remote_port}}\r\n##### {{$v.message}}\r\n{{end}}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)","WebhookContentType":"","Created":"2020-07-29T10:00:32.0648482Z"},{"Id":29,"Tpltype":"wx","Tpluse":"Graylog3","Tplname":"graylog3-wx","Tpl":"[Graylog3告警信息](.check_result.Event.Source)\r\n>**{{.check_result.event_definition_description}}**\r\n{{ range $k,$v:=.backlog }}\r\n>告警索引:{{$v.index}}\r\n开始时间:{{GetCSTtime $v.timestamp}}\r\n告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl_2_remote_port}}\r\n**{{$v.message}}**\r\n{{end}}","WebhookContentType":"","Created":"2020-07-29T10:03:29.2436267Z"},{"Id":30,"Tpltype":"fs","Tpluse":"Graylog3","Tplname":"graylog3-fs","Tpl":"**[Graylog3告警信息](.check_result.Event.Source)**\r\n*{{.check_result.event_definition_description}}*\r\n{{ range $k,$v:=.backlog }}\r\n告警索引:{{$v.index}}\r\n开始时间:{{GetCSTtime $v.timestamp}}\r\n告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl_2_remote_port}}\r\n**{{$v.message}}**\r\n{{end}}","WebhookContentType":"","Created":"2020-09-30T09:52:11.7065592Z"},{"Id":31,"Tpltype":"txdx","Tpluse":"Graylog3","Tplname":"graylog3-dx","Tpl":"{{ range $k,$v:=.backlog }}告警信息 {{$v.message}}{{end}}","WebhookContentType":"","Created":"2022-08-23T11:20:47.088395Z"},{"Id":32,"Tpltype":"txdh","Tpluse":"Graylog3","Tplname":"graylog3-dh","Tpl":"{{ range $k,$v:=.backlog }}告警信息 {{$v.message}}{{end}}","WebhookContentType":"","Created":"2022-08-23T11:21:01.5271001Z"},{"Id":33,"Tpltype":"email","Tpluse":"Graylog3","Tplname":"graylog3-email","Tpl":"

Graylog3告警信息

\r\n

{{.check_result.event_definition_description}}

\r\n{{ range $k,$v:=.backlog }}\r\n
告警索引:{{$v.index}}
\r\n
开始时间:{{GetCSTtime $v.timestamp}}
\r\n
告警主机:{{$v.fields.gl2_remote_ip}}:{{$v.fields.gl_2_remote_port}}
\r\n

{{$v.message}}

\r\n{{end}}\r\n","WebhookContentType":"","Created":"2020-07-29T10:53:20.5498706Z"},{"Id":34,"Tpltype":"dd","Tpluse":"Grafana","Tplname":"grafana-dd","Tpl":"{{if eq .state \"ok\"}}\r\n## [Grafana恢复信息]({{.ruleUrl}})\r\n#### {{.ruleName}}\r\n###### 告警级别:严重\r\n###### 开始时间:{{GetCSTtime \"\"}}\r\n##### {{.message}}\r\n{{else}}\r\n## [Grafana告警信息]({{.ruleUrl}})\r\n#### {{.ruleName}}\r\n###### 告警级别:严重\r\n###### 开始时间:{{GetCSTtime \"\"}}\r\n##### {{.message}}\r\n{{end}}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)","WebhookContentType":"","Created":"2020-07-29T11:40:33.5528424Z"},{"Id":35,"Tpltype":"wx","Tpluse":"Grafana","Tplname":"grafana-wx","Tpl":"{{if eq .state \"ok\"}}\r\n[Grafana恢复信息]({{.ruleUrl}})\r\n>**{{.ruleName}}**\r\n>告警级别:严重\r\n开始时间:{{GetCSTtime \"\"}}\r\n{{.message}}\r\n{{else}}\r\n[Grafana告警信息]({{.ruleUrl}})\r\n>**{{.ruleName}}**\r\n>告警级别:严重\r\n开始时间:{{GetCSTtime \"\"}}\r\n{{.message}}\r\n{{end}}","WebhookContentType":"","Created":"2020-07-29T11:41:07.2160147Z"},{"Id":36,"Tpltype":"fs","Tpluse":"Grafana","Tplname":"grafana-fs","Tpl":"{{if eq .state \"ok\"}}\r\n**[Grafana恢复信息]({{.ruleUrl}})**\r\n*{{.ruleName}}*\r\n告警级别:严重\r\n开始时间:{{GetCSTtime \"\"}}\r\n**{{.message}}**\r\n{{else}}\r\n**[Grafana告警信息]({{.ruleUrl}})**\r\n*{{.ruleName}}*\r\n告警级别:严重\r\n开始时间:{{GetCSTtime \"\"}}\r\n**{{.message}}**\r\n{{end}}","WebhookContentType":"","Created":"2020-09-30T09:53:04.178218Z"},{"Id":37,"Tpltype":"txdx","Tpluse":"Grafana","Tplname":"grafana-dx","Tpl":"{{if eq .state \"ok\"}}Grafana恢复信息{{.message}}{{else}}Grafana告警信息{{.message}}{{end}}","WebhookContentType":"","Created":"2022-08-23T11:21:21.1760057Z"},{"Id":38,"Tpltype":"txdh","Tpluse":"Grafana","Tplname":"grafana-dh","Tpl":"{{if eq .state \"ok\"}}Grafana恢复信息{{.message}}{{else}}Grafana告警信息{{.message}}{{end}}","WebhookContentType":"","Created":"2022-08-23T11:21:32.135424Z"},{"Id":39,"Tpltype":"email","Tpluse":"Grafana","Tplname":"grafana-email","Tpl":"{{if eq .state \"ok\"}}\r\n

Grafana恢复信息

\r\n

{{.ruleName}}

\r\n
告警级别:严重
\r\n
开始时间:{{GetCSTtime \"\"}}
\r\n

{{.message}}

\r\n{{else}}\r\n

Grafana恢复信息

\r\n

{{.ruleName}}

\r\n
告警级别:严重
\r\n
开始时间:{{GetCSTtime \"\"}}
\r\n

{{.message}}

\r\n{{end}}\r\n","WebhookContentType":"","Created":"2020-07-29T11:52:25.141749Z"},{"Id":40,"Tpltype":"dd","Tpluse":"SonarQube","Tplname":"sonar-dd-example","Tpl":"## [Sonar告警信息]({{.serverUrl}})\r\n###### 检测状态:{{.status}}\r\n###### 检测时间:{{.analysedAt}}\r\n###### ---------------------------------\r\n{{ range $k,$v:=.qualityGate.conditions}}\r\n###### metric:{{$v.metric}}\r\n###### errorThreshold:{{$v.errorThreshold}}\r\n###### operator:{{$v.operator}}\r\n###### status:{{$v.status}}\r\n###### -----------------------------------\r\n{{ end }}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)","WebhookContentType":"","Created":"2020-07-29T11:53:35.4294565Z"},{"Id":41,"Tpltype":"dd","Tpluse":"Jenkins","Tplname":"jenkins-dd-example","Tpl":"## [Jenkins构建信息]({{.buildUrl}})\r\n###### Jenkins地址:[{{.buildUrl}}]({{.buildUrl}})\r\n###### 构建项目:{{.projectName}}\r\n###### 构建事件:{{.event}}\r\n###### 构建名称:{{.buildName}}\r\n###### 构建时间:{{GetCSTtime \"\"}}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)","WebhookContentType":"","Created":"2020-07-29T11:54:02.2408626Z"},{"Id":42,"Tpltype":"fs","Tpluse":"Prometheus","Tplname":"prometheus-fsv2","Tpl":"{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}\r\n{{if eq $v.status \"resolved\"}}\r\n**[Prometheus恢复信息]({{$v.generatorURL}})**\r\n*[{{$v.labels.alertname}}]({{$var}})*\r\n告警级别:{{$v.labels.level}}\r\n开始时间:{{$v.startsAt}}\r\n结束时间:{{$v.endsAt}}\r\n故障主机IP:{{$v.labels.instance}}\r\n**{{$v.annotations.description}}**\r\n{{else}}\r\n**[Prometheus告警信息]({{$v.generatorURL}})**\r\n*[{{$v.labels.alertname}}]({{$var}})*\r\n告警级别:{{$v.labels.level}}\r\n开始时间:{{$v.startsAt}}\r\n结束时间:{{$v.endsAt}}\r\n故障主机IP:{{$v.labels.instance}}\r\n**{{$v.annotations.description}}**\r\n{{end}}\r\n{{ end }}","WebhookContentType":"","Created":"2020-11-20T08:05:04.2774152Z"},{"Id":43,"Tpltype":"workwechat","Tpluse":"Prometheus","Tplname":"prometheus-wechatapp","Tpl":"{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}\r\n{{if eq $v.status \"resolved\"}}\r\n[Prometheus恢复信息]({{$v.generatorURL}})\r\n>**[{{$v.labels.alertname}}]({{$var}})**\r\n>告警级别: {{$v.labels.level}}\r\n开始时间: {{$v.startsAt}}\r\n结束时间: {{$v.endsAt}}\r\n故障主机IP: {{$v.labels.instance}}\r\n**{{$v.annotations.description}}**\r\n{{else}}\r\n[Prometheus告警信息]({{$v.generatorURL}})\r\n>**[{{$v.labels.alertname}}]({{$var}})**\r\n>告警级别: {{$v.labels.level}}\r\n开始时间: {{$v.startsAt}}\r\n结束时间: {{$v.endsAt}}\r\n故障主机IP: {{$v.labels.instance}}\r\n**{{$v.annotations.description}}**\r\n{{end}}\r\n{{ end }}","WebhookContentType":"","Created":"2021-01-18T08:13:55.4321974Z"},{"Id":44,"Tpltype":"rl","Tpluse":"Prometheus","Tplname":"prometheus-ruliu","Tpl":"{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}\r\n{{if eq $v.status \"resolved\"}}\r\n## [Prometheus恢复信息]({{$v.generatorURL}})\r\n#### [{{$v.labels.alertname}}]({{$var}})\r\n###### 告警级别:{{$v.labels.level}}\r\n###### 开始时间:{{$v.startsAt}}\r\n###### 结束时间:{{$v.endsAt}}\r\n###### 故障主机IP:{{$v.labels.instance}}\r\n##### {{$v.annotations.description}}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)\r\n{{else}}\r\n## [Prometheus告警信息]({{$v.generatorURL}})\r\n#### [{{$v.labels.alertname}}]({{$var}})\r\n###### 告警级别:{{$v.labels.level}}\r\n###### 开始时间:{{$v.startsAt}}\r\n###### 结束时间:{{$v.endsAt}}\r\n###### 故障主机IP:{{$v.labels.instance}}\r\n##### {{$v.annotations.description}}\r\n![Prometheus](https://raw.githubusercontent.com/feiyu563/PrometheusAlert/master/doc/alert-center.png)\r\n{{end}}\r\n{{ end }}","WebhookContentType":"","Created":"2021-02-02T07:45:30.4080271Z"},{"Id":45,"Tpltype":"webhook","Tpluse":"WebHook","Tplname":"prometheus-webhook","Tpl":"{\r\n{{ $var := index .alerts 0}}\r\n{{if eq $var.status \"resolved\"}}\r\n\"title\": \"Prometheus恢复信息\",\r\n\"prometheus-url\": \"{{$var.generatorURL}}\",\r\n\"alert-name\": \"{{$var.labels.alertname}}\",\r\n\"alertmanager-url\": \"{{.externalURL}}\",\r\n\"alert-level\": \"{{$var.labels.level}}\",\r\n\"alert-start-time\": \"{{$var.startsAt}}\",\r\n\"alert-end-time\": \"{{$var.endsAt}}\",\r\n\"alert-instance\": \"{{$var.labels.instance}}\",\r\n\"message\": \"{{$var.annotations.description}}\"\r\n{{else}}\r\n\"title\": \"Prometheus告警信息\",\r\n\"prometheus-url\": \"{{$var.generatorURL}}\",\r\n\"alert-name\": \"{{$var.labels.alertname}}\",\r\n\"alertmanager-url\": \"{{.externalURL}}\",\r\n\"alert-level\": \"{{$var.labels.level}}\",\r\n\"alert-start-time\": \"{{$var.startsAt}}\",\r\n\"alert-end-time\": \"{{$var.endsAt}}\",\r\n\"alert-instance\": \"{{$var.labels.instance}}\",\r\n\"message\": \"{{$var.annotations.description}}\"\r\n{{end}}\r\n}","WebhookContentType":"","Created":"2021-04-29T08:04:12.6286475Z"},{"Id":46,"Tpltype":"wx","Tpluse":"ALiYun","Tplname":"aliyun","Tpl":"ALiYun {{.AlertState}}信息\r\n>**{{.AlertName}}**\r\n>告警级别: {{.TriggerLevel}}\r\n开始时间: {{GetTime .Timestamp}}\r\n故障主机: {{.InstanceName}}\r\n------------详细信息--------------\r\nmetricName: {{.MetricName}}\r\nexpression: {{.Expression}}\r\nsignature: {{.Signature}}\r\nmetricProject: {{.MetricProject}}\r\nuserId: {{.UserId}}\r\nnamespace: {{.Namespace}}\r\npreTriggerLevel: {{.PreTriggerLevel}}\r\nruleId: {{.RuleId}}\r\ndimensions: {{.Dimensions}}\r\n**当前值:{{.CurValue}}**","WebhookContentType":"","Created":"2021-07-14T06:57:31.4160134Z"},{"Id":47,"Tpltype":"voice","Tpluse":"Prometheus","Tplname":"prometheus-voice","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 }}","WebhookContentType":"","Created":"2022-06-09T06:35:06.3244096Z"},{"Id":48,"Tpltype":"fsapp","Tpluse":"Prometheus","Tplname":"prometheus-feishu-app","Tpl":"{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}{{if eq $v.status \"resolved\"}}**[Prometheus恢复信息]({{$v.generatorURL}})**\r\n*[{{$v.labels.alertname}}]({{$var}})*\r\n告警级别:{{$v.labels.level}}\r\n开始时间:{{$v.startsAt}}\r\n结束时间:{{$v.endsAt}} \r\n故障主机IP:{{$v.labels.instance}}\r\n**{{$v.annotations.description}}**{{else}}**[Prometheus告警信息]({{$v.generatorURL}})**\r\n*[{{$v.labels.alertname}}]({{$var}})*\r\n告警级别:{{$v.labels.level}}\r\n开始时间:{{$v.startsAt}}\r\n故障主机IP:{{$v.labels.instance}}\r\n**{{$v.annotations.description}}**{{end}}{{ end }}\r\n{{ $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)","WebhookContentType":"","Created":"2022-08-23T11:22:30.4313155Z"}]