npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hubot-pagerduty-pb

v0.0.4

Published

Hubot script. Interacts/integrates with PagerDuty API.

Downloads

4

Readme

A PagerDuty Hubot Module

PagerDuty is a service that aggregates your alerting systems and routes them. For example, you can get an alert from nagios that goes to your Operations team, and another from Airbrake that gets sent to your devs.

What this script does is integrate your Hubot with the PagerDuty API.

It provides a few features:

  • Ability to retrieve oncall rotation list for the current time
  • Poll for incoming incidents and send a message to an "incident room" (e.g., the Operations or Dev Team Rooms) with details.
  • Ability to interrogate, resolve and acknowledge incidents right from chat.
  • Ability to set override windows.

More features are coming. This was initially developed in house to scratch an itch, and others have expressed interest in making use of it.

Requirements and Installation

Add hubot-pagerduty to your hubot's package.json and npm install.

Then, copy node_modules/hubot-pagerduty/src/load_pagerduty.coffee into your hubot's scripts/ directory. You will only need to do this once, and will let you keep current with new updates.

You will also need to create a pagerdutyrc at the root of your hubot's path. This is a JSON object and consists of a few fields:

  • token: the API token you will use
  • api_subdomain: the pagerduty subdomain. If you use foo.pagerduty.com to login, this will be foo.
  • schedules: this is an array of two-element arrays. Position 0 is the schedule name, and position 1 is the schedule ID. If you go to the pagerduty website and look at a schedule, this will be the 6 digit alphanumeric code in the URL.
  • incident_room: this is room ID to send notifications on incoming alerts, and will be specific to your chat medium.
  • urgent_page_service_key: See "Urgent Page Facility" section below.
  • user_map: a mapping of chat usernames to pagerduty identifiers. Set 'Shell' for local testing (that will be the username there). Used in a few commands.

This is parsed with JSON.parse which does not allow comments. You've been warned!

Your file should look something like this:

{
    "token": "a_big_string_of_characters",
    "schedules": [
      [ "Level 1", "ABCDEFG" ],
      [ "Level 2", "HIJKLMN" ],
      [ "Level 3", "OPQRSTU" ],
      [ "Level 4", "VWXYZ12" ]
    ],
    "incident_room": "[email protected]",
    "api_subdomain": "mommas-basement",
    "urgent_page_service_key": "1231231231231231231231",
    "user_map": {
      "erikh": "WAKKAWAK",
      "Shell": "WAKKAWAK",
      "chris": "123DEFAB"
    }
}

(Note to irc users, you will have issues unless you use at least hubot 2.4.7 and hubot-irc 0.1.10)

Urgent Page Facility

The "Urgent Page Facility" allows anybody capable of talking to hubot to create a new incident. This can be extremely useful when non-technical staff who interact with the hubot need to alert Operations personnel and your monitoring system is not catching the issue.

To configure this, you need a "service key" from PagerDuty. To create this:

  • Click on the "Services" tab in the PagerDuty UI at the top.
  • Click on "Add a New Service"
  • Name your service and select the escalation policy these pages will route to.
  • Under "Service Type", select "Generic API Service".
  • Submit the Form.

On the page that appears next you will see a listing for a "service key", which is a big string of numbers. That's the value you need to put in your pagerdutyrc under urgent_page_service_key.

Authors

Hotel Tonight (www.hoteltonight.com) whipped this up. See the LICENSE file for distribution details.

Contributing

  • Fork the project
  • Make your changes.
    • Metadata changes such as to the license and authorship information will be rejected regardless how good your patch is.
  • Send a pull request to this repository with a friendly hello.
  • Have a beer.