modules/nixos/monitoring: import matrix-hook template

This commit is contained in:
zowoq 2023-08-21 19:49:28 +10:00
parent c4273d297d
commit d9bb98aa79
2 changed files with 12 additions and 1 deletions
modules/nixos/monitoring

View file

@ -34,7 +34,7 @@ in
MX_HOMESERVER = "https://matrix-client.matrix.org";
MX_ID = "@nix-community-matrix-bot:matrix.org";
MX_ROOMID = "!cBybDCkeRlSWfuaFvn:numtide.com";
MX_MSG_TEMPLATE = "${matrixHook}/message.html.tmpl";
MX_MSG_TEMPLATE = "${./message.html.tmpl}";
};
serviceConfig = {
Type = "simple";

View file

@ -0,0 +1,11 @@
<p>
{{ if eq .Status "firing" }}
🔥 <strong><font color="#ff0000">FIRING</font></strong>
{{ else if eq .Status "resolved"}}
✅ <strong><font color="#00ff00">RESOLVED</font></strong>
{{ else }}
<strong><font>{{.Status}}</font></strong> "
{{ end }} <code>[{{.Labels.instance}}]</code> >> <b>{{.Labels.alertname}}</b>
</br>
{{.Annotations.description}}
</p>