Extend readme, add matrix support room

This commit is contained in:
Julian-Samuel Gebühr 2022-08-24 20:40:51 +02:00
parent debf91d2f5
commit 1b802d5852
4 changed files with 34 additions and 9 deletions

View File

@ -1,3 +1,11 @@
![Alertbot banner](assets/alertbanner.png)
# Alertbot
This bot uses the webhook functionality of monitoring/alerting solutions like Grafana or Alertmanager to forward alerts to matrix rooms.
This means that you no longer have to use E-Mail or Slack to receive alerts. See the setup below for how to use it or
join the [Alertbot room on matrix](https://matrix.to/#/#alertbot:hyteck.de)
# Getting Started # Getting Started
**Prerequisites:** **Prerequisites:**
@ -29,7 +37,7 @@ the room where the alerts should be sent. Also find out the room id by asking th
**Configure alertmanager** # Setup Alertmanager
This configuration will send all your alerts to the room `!zOcbWjsWzdREnihgeC:example.com` (if the bot has access to it). This configuration will send all your alerts to the room `!zOcbWjsWzdREnihgeC:example.com` (if the bot has access to it).
Put in your own room-id (see above). Put in your own room-id (see above).
@ -51,17 +59,40 @@ route:
``` ```
# Setup Grafana
The grafana setup is fairly simple and can be used to forward grafana alerts to matrix.
![Screenshot of the Grafana Setup](assets/grafana.png)
# Test your setup
It can be a bit annoying to trigger an alert (e.g. by shutting down a server) to test if your configuration is right and if the bot works as intended.
Therefore, you find a few example alerts in `alert_examples/` which allow you to test the bot.
Use them with the following command (but adjust the webhook URL):
```bash
curl --header "Content-Type: application/json" \
--request POST \
--data "@alert_examples/data.json" \
https://webhook.example.com/_matrix/maubot/plugin/maubot/webhook/!zOcbWjsWzdREnihreC:example.com
```
# Local testing Setup # Local testing Setup
Also you might want to test the bot on your local machine
Use a domain e.g. webbhook.hyteck.de and configure nginx as Use a domain e.g. webbhook.hyteck.de and configure nginx as
reverse proxy for port 4242 for this domain. reverse proxy for port 4242 for this domain.
# Connect ## Connect
Run the local server and connect via (29316 is the local maubot port) Run the local server and connect via (29316 is the local maubot port)
`ssh -N -R 4242:localhost:29316 s` `ssh -N -R 4242:localhost:29316 s`
# Send some data with ## Send some data with
Put the following in `data.json` Put the following in `data.json`
```json ```json
@ -75,9 +106,3 @@ curl --header "Content-Type: application/json" \
https://webhook.hyteck.de/_matrix/maubot/plugin/maubot/webhook https://webhook.hyteck.de/_matrix/maubot/plugin/maubot/webhook
``` ```
# Grafana setup
The grafana setup is fairly simple and can be used to forward grafana alerts to matrix.
![Screenshot of the Grafana Setup](grafana.png)

BIN
assets/alert.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

BIN
assets/alertbanner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

View File

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB