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.

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.

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

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.