Hello,
I can only add one screen to the alert email screen.
I want to add images from different data sources to their respective screens. Could you help me with this?
I’ve been trying to do this in the template, but it didn’t work.
{{- /\* This is a copy of the "default.message". \*/ -}}
{{- /\* Edit the template name and template content as needed. \*/ -}}
{{ define "default.message.copy" }}
{{ if gt (len .Alerts.Firing) 0 }}
<b>Firing</b><br/>
{{ template "\__text_alert_list.copy" .Alerts.Firing }}
{{ end }}
{{ if gt (len .Alerts.Resolved) 0 }}
<b>Resolved</b><br/>
{{ template "\__text_alert_list.copy" .Alerts.Resolved }}
{{ end }}
<br/><br/>
<b>Ek Grafik / Detay Görünümü:</b><br/>
<img
src="[http://grafana:3000/render/d-solo/\*\*\*\*orgId=2&timezone=browser&panelId=1&hideLogo=true&width=10…](http://ovrbabil:1763/render/d-solo/urxg8v?orgId=2&timezone=browser&panelId=1&hideLogo=true&width=1000&height=500&tz=Europe%2FIstanbul%22 "http://ovrbabil:1763/render/d-solo/urxg8v?orgid=2&timezone=browser&panelid=1&hidelogo=true&width=1000&height=500&tz=europe%2fistanbul%22")
alt="Ek Grafik"
style="max-width:100%; height:auto; border:1px solid #ddd;"
/>
{{ end }}
{{ define "\__text_alert_list.copy" }}
{{ range . }}
Value: {{ template "\__text_values_list.copy" . }}
Labels:
{{ range .Labels.SortedPairs }} - {{ .Name }} = {{ .Value }}
{{ end }}
Annotations:
{{ range .Annotations.SortedPairs }} - {{ .Name }} = {{ .Value }}
{{ end }}
{{ if gt (len .GeneratorURL) 0 }}Source: {{ .GeneratorURL }}
{{ end }}
{{ if gt (len .SilenceURL) 0 }}Silence: {{ .SilenceURL }}
{{ end }}
{{ if gt (len .DashboardURL) 0 }}Dashboard: {{ .DashboardURL }}
{{ end }}
{{ if gt (len .PanelURL) 0 }}Panel: {{ .PanelURL }}
{{ end }}
{{ end }}
{{ end }}
{{ define "\__text_values_list.copy" }}
{{ if len .Values }}
{{ $first := true }}
{{ range $refID, $value := .Values -}}
{{ if $first }}{{ $first = false }}{{ else }}, {{ end }}{{ $refID }}={{ $value }}
{{ end -}}
{{ else }}\[no value\]{{ end }}
{{ end }}
Firing
Value:
[no value]
Labels:
- alertname = TestAlert
- instance = Grafana
Annotations:
- summary = Notification test
Silence: http://grafana:3000/alerting/silence/new?alertmanager=grafana&matcher=alertname%3DTestAlert&match…
Ek Grafik / Detay Görünümü:
<img
src=“http://grafana:3000/render/d-solo/****orgId=2&timezone=browser&panelId=1&hideLogo=true&width=10…”
alt=“Ek Grafik”
style=“max-width:100%; height:auto; border:1px solid #ddd;”
/>