Commit 721885d1 authored by Nicolas Lenz's avatar Nicolas Lenz
Browse files

Use matrix over commands as alerter

parent 8eab6317
matrix_token
curl -XPOST -d \
'{"msgtype":"m.text", "body": "**'"$1"' failed at '"$2"'!**\n\n**Info:** '"$3"'\n\nSee [status page](https://status.eisfunke.com/).", "format": "org.matrix.custom.html", "formatted_body": "<p><strong>'"$1"' failed at '"$2"'!</strong></p>\n<p><strong>Info:</strong> '"$3"'</p>\n<p>See <a href=\"https://status.eisfunke.com/\">status page</a>.</p>\n"}' \
"https://matrix.eisfunke.com/_matrix/client/r0/rooms/!IdECyERvrpwSahJNxT:eisfunke.com/send/m.room.message?access_token=$(cat matrix_token)"
curl -XPOST -d \
'{"msgtype":"m.text", "body": "**'"$1"' recovered.**\n\nSee [status page](https://status.eisfunke.com/).", "format": "org.matrix.custom.html", "formatted_body": "<p><strong>'"$1"' recovered.</strong></p>\n<p>See <a href=\"https://status.eisfunke.com/\">status page</a>.</p>\n"}' \
"https://matrix.eisfunke.com/_matrix/client/r0/rooms/!IdECyERvrpwSahJNxT:eisfunke.com/send/m.room.message?access_token=$(cat matrix_token)"
......@@ -3,7 +3,7 @@ interval=60
[reporting]
loggers=web
alerters=email
alerters=matrix
[web]
type=html
......@@ -12,8 +12,7 @@ filename=index.html
header=header.html
footer=footer.html
[email]
type=email
host=chiron.uberspace.de
from=monitor@herrmehren.de
to=root@eisfunke.com
[matrix]
type=execute
fail_command=/bin/bash matrix_fail.sh "{name}" "{failed_at}" "{info}"
success_command=/bin/bash matrix_success.sh "{name}"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment