xmpp-webhook

webhook to xmpp gateway (clone of https://github.com/opthomas-prime/xmpp-webhook/ with my own mods)
git clone https://git.e1e0.net/xmpp-webhook.git
Log | Files | Refs | README | LICENSE

README.md (1940B)


      1 # xmpp-webhook
      2 - Multipurpose XMPP-Webhook (Built for Prometheus/Grafana Alerts)
      3 - Based on https://github.com/atomatt/go-xmpp
      4 
      5 ## Status
      6 `xmpp-webhook` ~~currently~~ only provides a hook for Grafana. ~~I will implement a `parserFunc` for Prometheus ASAP~~. Check https://github.com/opthomas-prime/xmpp-webhook/blob/master/handler.go to learn how to support more source services.
      7 
      8 ## Usage
      9 - `xmpp-webhook` is configured via environment variables:
     10     - `XMPP_ID` - The JID we want to use
     11     - `XMPP_PASS` - The password
     12     - `XMPP_RECEIVERS` - Comma-seperated list of JID's
     13 - After startup, `xmpp-webhook` tries to connect to the XMPP server and provides the implemented HTTP enpoints (on `:4321`). e.g.:
     14 
     15 ```
     16 curl -X POST -d @grafana-webhook-alert-example.json localhost:4321/grafana
     17 ```
     18 - After parsing the body in the appropriate `parserFunc`, the notification is then distributed to the configured receivers.
     19 
     20 ## Installation
     21 IMPORTANT NOTE: For the sake of simplicity, `xmpp-webhook` is not reconnecting to the XMPP server after a connection-loss. If you use the provided `xmpp-webhook.service` - Systemd will manage the reconnect by restarting the service.
     22 
     23 - Download and extract the latest tarball (GitHub release page)
     24 - Install the binary: `install -D -m 744 xmpp-webhook /usr/local/bin/xmpp-webhook`
     25 - Install the service: `install -D -m 644 xmpp-webhook.service /etc/systemd/system/xmpp-webhook.service`
     26 - Configure XMMP credentials in `/etc/xmpp-webhook.env`. e.g.:
     27 
     28 ```
     29 XMPP_ID='bot@example.com'
     30 XMPP_PASS='passw0rd'
     31 XMPP_RECEIVERS='jdoe@example.com,ops@example.com'
     32 ```
     33 
     34 - Enable and start the service:
     35 
     36 ```
     37 systemctl daemon-reload
     38 systemctl enable xmpp-webhook
     39 systemctl start xmpp-webhook
     40 ```
     41 
     42 ## Building
     43 - Dependencies are managed via Go Modules (https://github.com/golang/go/wiki/Modules).
     44 - Clone the sources
     45 - Change in the project folder:
     46 - Build `xmpp-webhook`: `go build`
     47 
     48 ## Need help?
     49 Feel free to contact me!