Git Product home page Git Product logo

go-pagerduty-slack-sync's Introduction

This tool syncs one or more pagerduty schedules to two slack groups per schedule. The first slack group is a group with everyone who is in the pagerduty schedule and the second contains the current person on call.

For example if you have the following users in a pagerduty schedule:

schedule id: 1234
user1
user2
user3 <= currently on call

Then when you run a sync for the schedule using:

docker run -e RUN_INTERVAL_SECONDS=60 -e SLACK_TOKEN=xxx -e PAGERDUTY_TOKEN=xxx -e SCHEDULE_PLATFORM=1234,platform-engineer kevholditch/pagerduty-slack-sync:latest

The following slack groups would be created: - @all-oncall-platform-engineers - user1, user2, user3 - @current-oncall-platform-engineer - user3

Multiple schedules can be synced at once by passing many env variables beginning with SCHEDULE_. The format for the value that the schedule parameter expects is <pagerduty schedule id>/<group-name>. The <group name> will be used to build the two names for the slack groups using the following format: - all-oncall-<group-name>s - current-oncall-<group-name>

Full parameter list:

Env Name Description Default Value Example
PAGERDUTY_TOKEN Token used to talk to the PagerDuty API n/a xxxxx
SLACK_TOKEN Token used to talk to Slack API n/a xoxp-xxxxxx
SCHEDULE_ A PagerDuty schedule that you want to sync n/a 1234,platform-engineer
RUN_INTERVAL_SECONDS Run a sync every X seconds 60 300
PAGERDUTY_SCHEDULE_LOOKAHEAD How far into the future to evaluate Pagerduty schedules (Go time duration format) 2400h 8760h

Slack permissions

In order for the app to run you will need to create a bot with the following permissions:

usergroups:read
usergroups:write
users:read
users:read.email

If you have locked down your slack so only the admins can create groups then you have two options. You can either create the slack groups up front and the app will use those or you can give the bot user auth and give it admin perssions:

admin.usergroups:read
admin.usergroups:write
usergroups:read
usergroups:write
users:read
users:read.email

go-pagerduty-slack-sync's People

Contributors

kevholditch avatar kevholditch-f3 avatar cjduffett avatar peterbuecker-form3 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.