Skip to content

aikram24/python-pagerduty-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pagerduty Chatbot Python

A pagerduty chat bot using lins05/slackbot as a framework.

Installation

git clone https://github.com/aikram24/python-pagerduty-chatbot.git

pip install -r requirements.txt

Usage

Generate tokens

  1. Generate an api token on slack web api page
  • Update SLACK_API_TOKEN in slackbot_settings.py
  1. Generate bot user integration by going https://.slack.com/apps/build/custom-integration
  • Update API_TOKEN in slackbot_settings.py
  1. Genrate Pagerduty token V2
  • Update PAGER_DUTY_API in slackbot_settings.py

Run the bot

python run_bot.py

Available Commands

  • ls oncall - list oncall users
  • who( is|se) oncall - list oncall users
  • eoc - list oncall users
  • Oncall for <Schedule Name>
  • ls oncall for <Schedule Name> - list oncall users for specific schedule
  • who( is|se) oncall for <Schedule Name> - list oncall users for specific schedule
  • eoc for <Schedule Name> - list oncall users for specific schedule

Team Member assoicate with Schedule

  • ls schedule - list all members for mentioned schedule

Services / Alert Help

  • ls services - list all the services available for hail through API
  • ls service for <Service Name> - Give the service API Key
  • trigger | trig | hail <Service Name> <Message> = Ping the group with message and will you give you the incident_key'