This tool accepts Alertmanager webhook notification HTTP POST requests and forwards them to Keybase. It also offers a Watchdog feature where if notifications are not received at a regular interval, an alert will be fired to Keybase.
This project vendors its dependencies and they are maintained using Go modules.
$ go build -mod=vendor .
$ ./kbam -recipient <keybase recipient>
Additional options are available to tweak behaviour:
$ ./kbam --help
Usage of ./kbam:
-expiry duration
The amount of time after which a non-pinging watchdog check will be considered to have expired (default 2m0s)
-interval duration
The interval at which to check for watchdog expiry (default 10s)
-keybase string
the location of the Keybase app (default "keybase")
-port int
Port to listen for webhooks (default 3000)
-template string
Go text template definition file (default "default.tmpl")
-recipient string
Keybase recipient to send message to:
1) 'team#channel' - to teams
2) 'username' - directly to a user
In a similar way to Alertmanager itself, keybase-alertmanager offers customisable templating via Go's built-in text templating. See default.tmpl
for defaults. Note that the Go template file must define templates named: keybaseAlert
, watchdogAlertFire
and watchdogAlertRecover
.
A custom template file can be used by specifying the -template <file path>
command line option.
global:
resolve_timeout: 5m
route:
receiver: keybase
group_by:
- job
routes:
- receiver: watchdog
match:
alertname: Watchdog
group_wait: 15s
group_interval: 30s
repeat_interval: 1m
repeat_interval: 1h
receivers:
- name: noop-receiver
- name: keybase
webhook_configs:
- send_resolved: true
url: http://keybase-alertmanager.default:3000/webhook
- name: watchdog
webhook_configs:
- url: http://keybase-alertmanager.default:3000/watchdog