Giter Club home page Giter Club logo

pagerduty-tools's Introduction

pagerduty-tools

Tools to work around the current limitations in the PagerDuty API.

Installing

First, clone the GitHub repo:

$ git clone git://github.com/precipice/pagerduty-tools.git

If you don't already have Bundler installed, do that now:

$ gem install bundler

Then install required gems via Bundler:

$ bundle install

oncall.rb

The oncall.rb script reports who is currently on call for your PagerDuty account. Invoked with no arguments, it will list all on-call levels (1..n). If one or more levels are given as arguments, it will only list those levels.

The script logs into the PagerDuty site when first run. Your email address will be used to find associated PagerDuty accounts, and you can choose the account you want to report on. After the first run, a login cookie is kept in your home directory to allow future runs to be automatic (e.g., from cron).

The output of the script is meant to be suitable for use as a Campfire room topic, which is how we're currently using it. (Pull requests welcome if you want another output format.)

If the on call level has an associated on-call rotation, the name of that rotation is used in the output. Otherwise, a generic Level <#> format is used.

Calling the script with -h or --help will display some help.

Campfire Support

If you would like to have your current PagerDuty rotation assignments listed as the topic of a Campfire room, add a configuration file at ~/.pagerduty-campfire.yaml containing the following:

site:  https://example.campfirenow.com
room:  99999
token: abababababababababababababababababababab

with the values changed to match your configuration. I'd recommend running:

$ chmod 0600 ~/.pagerduty-campfire.yaml

after creating it. You can then invoke oncall.rb with a -t or --campfire-topic option, and the output of the script will be set as the topic for the configured room. We do this out of cron right after the rotation turns over to a new assignment.

Examples

$ ./oncall.rb
Hotseat: John Henry, Hotseat Backup: Lisa Limon, Level 3: Steven Sanders

$ ./oncall.rb 1 2
Hotseat: John Henry, Hotseat Backup: Lisa Limon

$ ./oncall.rb --campfire-topic 1 2
[No shell output, but the configured Campfire room's topic becomes:
"Hotseat: John Henry, Hotseat Backup: Lisa Limon"]

alerts-by-day.rb

This script is being revised and doesn't work with the rest of the package yet.

rotation-report.rb

This one is brand-new and doesn't do much yet.

License

Copyright 2011 Marc Hedlund. Distributed under the Apache License, version 2.0.

pagerduty-tools's People

Contributors

precipice 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.