Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

A Prometheus Alertmanager Webhook processor to send Keybase alerts

License

Notifications You must be signed in to change notification settings

damomurf/keybase-alertmanager

Repository files navigation

Keybase Alertmanager Webhook Notification Handler

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.

Building

This project vendors its dependencies and they are maintained using Go modules.

$ go build -mod=vendor .

Running

$ ./kbam -user <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")
  -user string
        Keybase user to send message to

Templates

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.

Example Alertmanager Configuration

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

About

A Prometheus Alertmanager Webhook processor to send Keybase alerts

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published