GithubHelp home page GithubHelp logo

isabella232 / opsreview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lyft/opsreview

0.0 0.0 0.0 21 KB

Compile a report of recent PagerDuty alerts for a single escalation policy.

License: MIT License

Python 100.00%

opsreview's Introduction

opsreview

Compile a report of recent PagerDuty alerts for a given list of escalation policies.

Build Status

Purpose

To keep the on-call duty tolerable, it's important to regularly review recent alerts and determine what actions need to be taken. That might be fixing the originating issue, or modifying your alerting behaviors.

Using the opsreview tool, you can quickly compile a report on recent alerts for a single escalation policy and determine what actions should be taken.

Example Output

> python pull_alerts.py

Time: Tuesday, January 19 - 9:19 AM
Service: api
Description: Failing API alarm: CRON failure
URL: https://subdomain.pagerduty.com/incidents/ABC123
Notes:
['[email protected]: #a - Re-ran CRON']

Time: Tuesday, January 19 - 12:03 PM
Service: api
Description: Failing API alarm: CPU percent > 10
URL: https://subdomain.pagerduty.com/incidents/ABC124
Notes:
['[email protected]: #na - Temporary spike in CPU, no action taken. Alert is too sensitive.']

Time: Tuesday, January 19 - 1:35 PM
Service: www
Description: Failing WWW alarm: 5XX percent > 5
URL: https://subdomain.pagerduty.com/incidents/ABC125
Notes:
['[email protected]: #a - Bad deploy']

Setup

Update your settings. To get an API token, go to the "User Settings" tab on your PagerDuty profile and click "Create API User Token". Make sure to use a v2 token.

cp settings_example.py settings.py

# Update settings.py for your PagerDuty escalation policy.
#
# PAGERDUTY_API_TOKEN = 'yourapitoken'
# ESCALATION_POLICIES = ['PYODVQB']  # Get from https://yoursubdomain.pagerduty.com/escalation_policies#PYODVQB

Set up your environment.

pip3 install virtualenv
virtualenv venv3
source venv3/bin/activate
pip install -r requirements.txt

Run the script.

python pull_alerts.py

opsreview's People

Contributors

babldev avatar chriselion avatar ikonst avatar krisdestruction avatar l1redd avatar lizneu avatar maxflav avatar mxr avatar zimathias 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.