Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A documented python library to consume the full pingdom API

Project Description

Written by: Kenneth Wilke <kenneth.wilke@gmail.com>

This is a python library to provide full access to the pingdom API, along with a few additional features to make using the API easier and pythonic.

Usage examples

Connecting to pingdom

import pingdomlib
api = pingdomlib.Pingdom(username, password, apikey)

Show all checks that are not in ‘UP’ status

# See pingdomlib.pingdom documentation to see available calls and settings
pingdomchecks = api.getChecks()
for check in pingdomchecks:
    # See pingdomlib.check documentation for information on PingdomCheck class
    if check.status != 'up':
        print check

Creating a new check

newcheck = api.newCheck("New check name", "www.hostnametocheck.com")

Updating a check

# Updates to check objects are pushed immediately to pingdom
newcheck.paused = True

Disabling change pushing for checks

api.pushChanges = False

Get last 10 pingdom alerts sent

import datetime
for alert in api.alerts(limit=10):
    time = datetime.datetime.fromtimestamp(alert['time'])
    timestamp = time.strftime('%Y-%m-%d %H:%M:%S')

    print "[%s] %s is %s" % (time, alert['name'], alert['status'])

Get outages for a specific check

import datetime
check = api.getCheck(227878)
for outage in check.outages():
    # timestamp conversion
    time_start = datetime.datetime.fromtimestamp(outage['timefrom'])
    timestamp_start = time_start.strftime('%Y-%m-%d %H:%M:%S')
    time_end = datetime.datetime.fromtimestamp(outage['timeto'])
    timestamp_end = time_end.strftime('%Y-%m-%d %H:%M:%S')

    print "%s: %s from %s to %s [%dm]" % (check.name, outage['status'],
                                          timestamp_start, timestamp_end,
                                          (outage['timeto'] -
                                          outage['timefrom']) / 60)

Contributors

  • Wil Clouser
  • Ash Berlin
  • Wu Jiang
  • Gertjan Oude Lohuis
  • Benjamin Boudreau
  • Britt Gresham
  • Allard Hoeve
  • Willem de Groot
  • Aaron Fay
  • Rick van de Loo
  • Oleksandr Kushchenko
  • Steven Bailey

Special thanks

Anders Ekman, Pingdom, for offering warm and helpful support with the API

TODO list

Planned improvements

  • Optional Gzip Compression
  • Improve check update process with pushChanges disabled
Release History

Release History

This version
History Node

2.0.3

History Node

2.0.2

History Node

2.0.1

History Node

2.0.0

History Node

1.9

History Node

1.8

History Node

1.7

History Node

1.6

History Node

1.5

History Node

1.4

History Node

1.3

History Node

1.2

History Node

1.1

History Node

1.0

History Node

0.1.6

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
PingdomLib-2.0.3.tar.gz (18.1 kB) Copy SHA256 Checksum SHA256 Source Feb 26, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting