Code Monkey home page Code Monkey logo

pagerdutyreporter's Introduction

PD

Simple script to read and group PagerDuty Incidents

Setup

Add a Pagerduty API key to ~/.pd.toml or use flag --key='<your key>'

Optional Config file

A config file can be provided at ~/.pd.toml

Format is:

#Required
[pagerduty]
api_token="xxxyyyzzzaaabbbccc"

#Optional
[confluence]
user_email="[email protected]"
api_token="<your Confluence key>"
space_key="<The Confluence Space key where you want to create documents>"

Help

./pd.py -h

Flags

--help (-h) Show this help message

--teams (-t) Pagerduty Team IDs, comma separated

--services (-s) Pagerduty Service IDs, comma separated

--logs (-l) Read log entries for each incident

--notes (-n) Read notes for each incident

--key (-k) PagerDuty API key - defaults to looking for a ~/.pd.toml file

--csv (-c) Output as csv

--group (-g) Group by field, e.g. --group="description"

--fuzz (-z) Fuzz matching on grouping

--fuzz-score (-m) Fuzz matching threshold - default is 90%

--full (-f) Full descriptions, default is to shorten

--debug (-x) Debug output

--report (-r) Output full report

--confluence (-w) Create a page in Confluence with the results [Not implemented]

Examples

Show incidents for a team and service.

./pd --teams=PXXXXX --services=P2APAXX 2022-10-25

'Full' report on a couple of teams/services. Parse the logs for acknowledger names, full descriptions in output, fuzzy match descriptions when grouping

./pd -t PXXXXX,PXXXXY -s P2APAXX,P2APAXY --report -l -f -z 2023-03-2

[Super simple implementation] create a doc in Confluence with grouped incidents

./pd -t PXXXXX --format=confluence -l -f -z --group="Description" 2023-03-08

pagerdutyreporter's People

Contributors

picklechops avatar

Watchers

 avatar  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.