Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to setup Python command line tool for PagerDuty
Here is a quick instructions on how to setup the Python command line tool for PagerDuty.
1) You'll need to have Python installed (tested with Python 2.6.1)
2) Verify if Python setuptools are installed
python -c "import setuptools;print 'OK';"
if you don't see output "OK", then setuptools are not installed.
To install setuptools, download setuptools ( appropriate to your Python major version. ("python --version" to get the version number).
For example, to install setuptools for For Python 2.6.x:
sudo sh setuptools-0.6c11-py2.6.egg
3) Install PagerDuty Python command-line tool
wget -O pagerduty.tar.gz --no-check-certificate
tar -zxvf pagerduty.tar.gz
cd samuel-python-pagerduty-0eefe24
sudo ./ install
You'll now have a "pagerduty" command-line tool installed in your system
4) PagerDuty Setup
Create a Generic API service in PagerDuty and obtain the api key
5) You can view the usage via "pagerduty --help"
e.g usage:
pagerduty --key="04c29f9081e0012d407b12313d009e57" --incident="" --description="a description that is read on the phone" trigger
pagerduty --key="04c29f9081e0012d407b12313d009e57" --incident="" acknowledge
pagerduty --key="04c29f9081e0012d407b12313d009e57" --incident="" resolve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.