dnscontrol/docs/notifications.md
Jan-Philipp Benecke d3a90f0a2d
Added slack notifications (#749)
* Added slack notification

* Added slack notification to doc.

* Send notifications as single message & updated doc. example

* Remove not needed variable
2020-05-29 09:26:48 -04:00

1.9 KiB

layout title
default Notifications

Notifications

DNSControl has build in support for notifications when changes are made. This allows you to post messages in team chat, or send emails when dns changes are made.

Notifications are written in the notifications package, and is a really simple interface to implement if you want to add new types or destinations.

Configuration

Notifications are set up in your credentials json file. They will use the notifications key to look for keys or configuration needed for various notification types.

  "r53": {
      ...
    },
  "gcloud": {
        ...
  } ,
  "notifications":{
      "slack_url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
  }

You also must run dnscontrol preview or dnscontrol push with the -notify flag to enable notification sending at all.

Notification types

Slack/Mattermost

If you want to use the Slack integration, you need to create a webhook in Slack. Please see the Slack documentation or the Mattermost documentation

Configure slack_url to this webhook. Mattermost works as well, as they share the same api,

Bonfire

This is stack overflow's built in chat system. This is probably not useful for most people.

Configure bonfire_url to be the full url including room and api key.

Future work

Yes, this seems pretty limited right now in what it can do. We didn't want to add a bunch of notification types if nobody was going to use them. The good news is, it should be really simple to add more. We gladly welcome any PRs with new notification destinations. Some easy possibilities:

  • Email
  • Generic Webhooks

Please update this documentation if you add anything.