Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Timothée Floure 9f572eb5c6
Add now-required go.mod file
2 years ago
.gitignore Refactor, read configuration from file 3 years ago
LICENSE Add LICENSE (GPLv3) 3 years ago
Makefile Fix typo in Makefile 3 years ago
README.md Allow HTTP listen address configuration 3 years ago
config.toml.sample Allow HTTP listen address configuration 3 years ago
go.mod Add now-required go.mod file 2 years ago
main.go Display name label on matrix notification 3 years ago
mock-webhook.sh Properly handle incoming hooks 3 years ago



Simple daemon - less than 150 lines of Go - forwarding prometheus-alertmanager events to matrix room. While there already is a matrix-alertmanager project out there, use of the JavaScript ecosystem made it rather painful to use from my point of view.


Make sure you have Go installed (golang-bin package on Fedora).

make getDeps
make build


Note: you are supposed to expose this service via a proxy such as Nginx, providing basic HTTP authentication.

I (master|✚1) ~/W/f/matrix-alertmanager-receiver » ./matrix-alertmanager-receiver --help
Usage of ./matrix-alertmanager-receiver:
  -config string
    	Path to configuration file (default "/etc/matrix-alertmanager-receiver.toml")
I [2] (master|✚1) ~/W/f/matrix-alertmanager-receiver » cat config.toml
Homeserver = "https://staging.matrix.ungleich.cloud"
TargetRoomID = "!jHFKHemgIAaDJekoxN:matrix-staging.ungleich.ch"
MXID = "@fnux:matrix-staging.ungleich.ch"
MXToken = "secretsecretsecret"
HTTPPort = 9088
HTTPAddress = ""
I (master|✚1) ~/W/f/matrix-alertmanager-receiver » ./matrix-alertmanager-receiver -config config.toml
2020/05/03 10:50:47 Reading configuration from config.toml.
2020/05/03 10:50:47 Connecting to Matrix Homserver https://staging.matrix.ungleich.cloud as @fnux:matrix-staging.ungleich.ch.
2020/05/03 10:50:47 @fnux:matrix-staging.ungleich.ch is already part of !jHFKHemgIAaDJekoxN:matrix-staging.ungleich.ch.
2020/05/03 10:50:47 Listening for HTTP requests (webhooks) on :9088
2020/05/03 10:50:55 Received valid hook from [::1]:44886
2020/05/03 10:50:55 > FIRING instance example1 is down