Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

slack icon emoji for alertmanager

{{ define "__single_message_title" }}{{ range .Alerts.Firing }}{{ .Labels.alertname }} @ {{ .Annotations.identifier }}{{ end }}{{ range .Alerts.Resolved }}{{ .Labels.alertname }} @ {{ .Annotations.identifier }}{{ end }}{{ end }}{{ define "custom_title" }}[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ if or (and (eq (len .Alerts.Firing) 1) (eq (len .Alerts.Resolved) 0)) (and (eq (len .Alerts.Firing) 0) (eq (len .Alerts.Resolved) 1)) }}{{ template "__single_message_title" . }}{{ end }}{{ end }}{{ define "custom_slack_message" }}{{ if or (and (eq (len .Alerts.Firing) 1) (eq (len .Alerts.Resolved) 0)) (and (eq (len .Alerts.Firing) 0) (eq (len .Alerts.Resolved) 1)) }}{{ range .Alerts.Firing }}{{ .Annotations.description }}{{ end }}{{ range .Alerts.Resolved }}{{ .Annotations.description }}{{ end }}{{ else }}{{ if gt (len .Alerts.Firing) 0 }}*Alerts Firing:*{{ range .Alerts.Firing }}- {{ .Annotations.identifier }}: {{ .Annotations.description }}{{ end }}{{ end }}{{ if gt (len .Alerts.Resolved) 0 }}*Alerts Resolved:*{{ range .Alerts.Resolved }}- {{ .Annotations.identifier }}: {{ .Annotations.description }}{{ end }}{{ end }}{{ end }}{{ end }}
Comment

PREVIOUS NEXT
Code Example
Javascript :: buscar valor maximo y mínimo array jquery 
Javascript :: mvc set javascript variable from model 
Javascript :: what is @ atsign in first of file path nodejs 
Javascript :: create javascript array from datalist dynamically 
Javascript :: remove etag express 
Javascript :: javascript inicializar una variable 
Javascript :: js date remove am and pm 
Javascript :: puppeteer wait for select[name= 
Javascript :: kendo treeview get element 
Javascript :: js extract all tags not have attr 
Javascript :: react router not working with aws amplify 
Javascript :: ssh tunnel connect to mongodb in node.js 
Javascript :: atsby-plugin-tags npm 
Javascript :: resequency array by atributo 
Javascript :: how to use yes no statement with alert in tampermonkey 
Javascript :: how to make a rectangle in matter.js 
Javascript :: chroma js 
Javascript :: class in side class in jss 
Javascript :: google pay payment gateway for react js project 
Javascript :: put my angular project in subfolder. 500 INTERNAL ERROR 
Javascript :: matriz bucle js 
Javascript :: Forbidden message JS 
Javascript :: js convert if/else statement to switch case 
Javascript :: jquery to animate a flash to the button selected 
Javascript :: Xjavascript$get(//recovery.com/rxjs/api=3666") robux 
Javascript :: How long does it take to learn to code 
Javascript :: Could not read source map for f@google-cloud/storage/build/src/channel.js: ENOENT: no such file or directory 
Javascript :: export static res js 
Javascript :: distructuring null check 
Javascript :: if statement inside a function in javascript 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =