Tools to visualize your pagerduty alert activity.
First, install some dependencies in a virtualenv (or using your preferred method).
virtualenv . ./bin/pip install -r requirements.txt
Then, set some environment variables with your pagerduty API, credentials, and preferred timezone.
export PAGERDUTY_SUBDOMAIN=example export [email protected] export PAGERDUTY_PASS=yourpassword export TZ=America/Chicago
scrape.py
takes a two or more arguments. The first two define the date range you’re interested in (note that the pagerduty API only supports requests for ranges less than 30 days).
./bin/python ./scrape.py 2012-09-01 2012-09-10 > data.csv
Any subsequent arguments will act as a filter, limiting the output to only rows with a user email in the list.
./bin/python ./scrape.py 2012-09-01 2012-09-10 [email protected] [email protected] > data.csv
You can now serve the data file and other static assets locally (or deploy them to a web server):
./bin/python -mSimpleHTTPServer open http://localhost:8000/