All Projects → hubot-scripts → hubot-pager-me

hubot-scripts / hubot-pager-me

Licence: MIT license
PagerDuty integration for Hubot

Programming Languages

coffeescript
4710 projects
shell
77523 projects

Projects that are alternatives of or similar to hubot-pager-me

hubot-broadlink-rm
A hubot script to learn and send IR hex codes with Broadlink RM
Stars: ✭ 24 (-67.57%)
Mutual labels:  hubot, hubot-scripts
hubot-seen
A hubot script that tracks when/where users were last seen.
Stars: ✭ 25 (-66.22%)
Mutual labels:  hubot, hubot-scripts
hubot-github-repo-event-notifier
Notifies about any GitHub repo event available via webhook.
Stars: ✭ 58 (-21.62%)
Mutual labels:  hubot, hubot-scripts
hubot-ansible
A hubot script for launching ansible commands
Stars: ✭ 14 (-81.08%)
Mutual labels:  hubot, hubot-scripts
hubot-analytics
📈 A hubot script to get google analytics reports
Stars: ✭ 16 (-78.38%)
Mutual labels:  hubot, hubot-scripts
hubot-code-review
A Hubot script for GitHub code review on Slack.
Stars: ✭ 38 (-48.65%)
Mutual labels:  hubot, hubot-scripts
hubot-group-alias
@mentions for groups using Hubot
Stars: ✭ 14 (-81.08%)
Mutual labels:  hubot, hubot-scripts
Hubot Slack
Slack Developer Kit for Hubot
Stars: ✭ 2,260 (+2954.05%)
Mutual labels:  hubot
Hubot Xmpp
XMPP adapter for Hubot
Stars: ✭ 185 (+150%)
Mutual labels:  hubot
Pull Review
✅ Assign pull request reviewers intelligently.
Stars: ✭ 179 (+141.89%)
Mutual labels:  hubot
Hubot Telegram
Hubot adapter for Telegram
Stars: ✭ 152 (+105.41%)
Mutual labels:  hubot
Sactive Bot
😈 An extensible chat bot framework. sactive-bot is an evolution of the open source hubot project. - https://www.shipengqi.top/sactive-bot .
Stars: ✭ 212 (+186.49%)
Mutual labels:  hubot
Huggies
Huggies is a plug and play automation tool for AWS Elastic Beanstalk
Stars: ✭ 13 (-82.43%)
Mutual labels:  hubot
mattermost-client
Mattermost client using websockets
Stars: ✭ 59 (-20.27%)
Mutual labels:  hubot
hubot-alias
Action alias for hubot
Stars: ✭ 21 (-71.62%)
Mutual labels:  hubot
pagerduty-exporter
Prometheus exporter for PagerDuty informations
Stars: ✭ 38 (-48.65%)
Mutual labels:  pagerduty
gubot
A hubot like bot written in golang which is langage agnostic and cloud agnostic
Stars: ✭ 29 (-60.81%)
Mutual labels:  hubot
Hubot Matteruser
Hubot adapter for Mattermost using Web API and Websockets
Stars: ✭ 175 (+136.49%)
Mutual labels:  hubot
hubot-schedule
A hubot script to schedule a message in both cron-style and datetime-based format pattern
Stars: ✭ 46 (-37.84%)
Mutual labels:  hubot
evolution
proposals for changes and user-visible enhancements to Hubot
Stars: ✭ 42 (-43.24%)
Mutual labels:  hubot

hubot-pager-me

npm version Node CI

PagerDuty integration for Hubot.

Installation

In your hubot repository, run:

npm install hubot-pager-me --save

Then add hubot-pager-me to your external-scripts.json:

["hubot-pager-me"]

Configuration

Upgrading from v2.x? The HUBOT_PAGERDUTY_SUBDOMAIN parameter has been replaced with HUBOT_PAGERDUTY_FROM_EMAIL, which is sent along as a header to indicate the actor for the incident creation workflow. This would be the email address for a bot user in PagerDuty.

Environment Variable Required? Description
HUBOT_PAGERDUTY_API_KEY Yes The REST API Key for this integration.
HUBOT_PAGERDUTY_FROM_EMAIL Yes The email of the default "actor" user for incident creation and modification.
HUBOT_PAGERDUTY_USER_ID No* The user ID of a PagerDuty user for your bot. This is only required if you want chat users to be able to trigger incidents without their own PagerDuty user.
HUBOT_PAGERDUTY_SERVICE_API_KEY No* The Incident Service Key to use when creating a new incident. This should be assigned to a dummy escalation policy that doesn't actually notify, as Hubot will trigger on this before reassigning it.
HUBOT_PAGERDUTY_SERVICES No Provide a comma separated list of service identifiers (e.g. PFGPBFY,AFBCGH) to restrict queries to only those services.
HUBOT_PAGERDUTY_SCHEDULES No Provide a comma separated list of schedules identifiers (e.g. PFGPBFY,AFBCGH) to restrict queries to only those schedules.

* - May be required for certain actions.

Webhook

Environment Variable Required? Description
HUBOT_PAGERDUTY_ENDPOINT Yes PagerDuty webhook listener on your Hubot's server. Must be public. Example: /hook.
HUBOT_PAGERDUTY_ROOM Yes Room in which you want the pagerduty webhook notifications to appear. Example: #pagerduty

To setup the webhooks and get the alerts in your chatrooms, you need to add the endpoint you define here (e.g /hooks) in the service settings of your PagerDuty accounts. You also need to define the room in which you want them to appear. That is, unless you want to spam all the rooms with alerts, but we don't believe that should be the default behavior. 😁

Example interactions

Trigger an incident assigned to a specific user:

technicalpickles> hubot pager trigger jnewland omgwtfbbq
hubot> technicalpickles: :pager: triggered! now assigning it to the right user...
hubot> technicalpickles: :pager: assigned to jnewland!

Trigger an incident assigned to an escalation policy:

technicalpickles> hubot pager trigger ops site is down
hubot> Shell: :pager: triggered! now assigning it to the right user...
hubot> Shell: :pager: assigned to ops!

Check on open incidents:

technicalpickles> hubot pager sup
hubot>
      Triggered:
      ----------
      8: 2014-11-05T20:17:50Z site is down - @technicalpickles - assigned to jnewland

      Acknowledged:
      -------------
      7: 2014-11-05T20:16:29Z omgwtfbbq - @technicalpickles - assigned to jnewland

Acknowledge triggered alerts assigned to you:

jnewland> /pager ack
hubot> jnewland: Incident 9 acknowledged

Resolve acknowledged alerts assigned to you:

jnewland> /pager resolve
hubot> jnewland: Incident 9 resolved

Check up coming schedule, and schedule shift overrides on it:

technicalpickles> hubot pager schedules
hubot> * Ops - https://urcompany.pagerduty.com/schedules#DEADBEE
technicalpickles> hubot pager schedule ops
hubot> * 2014-06-24T09:06:45-07:00 - 2014-06-25T03:00:00-07:00 technicalpickles
       * 2014-06-25T03:00:00-07:00 - 2014-06-26T03:00:00-07:00 jnewland
       * 2014-06-26T03:00:00-07:00 - 2014-06-27T03:00:00-07:00 technicalpickles
       * 2014-06-27T03:00:00-07:00 - 2014-06-28T03:00:00-07:00 jnewland
       * 2014-06-28T03:00:00-07:00 - 2014-06-29T03:00:00-07:00 technicalpickles
technicalpickles> hubot pager override ops 2014-06-25T03:00:00-07:00 - 2014-06-26T03:00:00-07:00 chrislundquist
hubot> Override setup! chrislundquist has the pager from 2014-06-25T06:00:00-04:00 until 2014-06-26T06:00:00-04:00
technicalpickles> hubot pager schedule
hubot> * 2014-06-24T09:06:45-07:00 - 2014-06-25T03:00:00-07:00 technicalpickles
       * 2014-06-25T03:00:00-07:00 - 2014-06-26T03:00:00-07:00 chrislundquist
       * 2014-06-26T03:00:00-07:00 - 2014-06-27T03:00:00-07:00 technicalpickles
       * 2014-06-27T03:00:00-07:00 - 2014-06-28T03:00:00-07:00 jnewland
       * 2014-06-28T03:00:00-07:00 - 2014-06-29T03:00:00-07:00 technicalpickles

Conventions

hubot-pager-me makes some assumptions about how you are using PagerDuty:

  • PagerDuty email matches chat email
    • override with hubot pager me as <pagerduty email>
  • The Service used by hubot-pager-me should not be assigned to an escalation policy with real people on it. Instead, it should be a dummy user that doesn't have any notification rules. If this isn't done, the escalation policy assigned to it will be notified, and then Hubot will immediately reassign to the proper team

Development

Fork this repository, and clone it locally. To start using with an existing Hubot for testing:

  • Run npm install in hubot-pager-me repository
  • Run npm link in hubot-pager-me repository
  • Run npm link hubot-pager-me in your Hubot directory
  • NOTE: if you are using something like nodenv or similar, make sure your npm link from the same node version

There's a few environment variables useful for testing:

  • HUBOT_PAGERDUTY_NOOP: Don't actually make POST/PUT HTTP requests.
  • HUBOT_PAGERDUTY_TEST_EMAIL: Force email of address to this for testing.

Resources

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].