Skip to main content

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

Project details


Download files

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

Source Distribution

PingdomLib3-3.0.0.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PingdomLib3-3.0.0-py2.py3-none-any.whl (20.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file PingdomLib3-3.0.0.tar.gz.

File metadata

  • Download URL: PingdomLib3-3.0.0.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/36.5.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.10

File hashes

Hashes for PingdomLib3-3.0.0.tar.gz
Algorithm Hash digest
SHA256 ad11979d6fcdc2b8312310d4e9e520d2ac3ce8a2a835c6941f58c28fc702bf25
MD5 b4c1867c3cc7ccc59041a92d12e6f2b6
BLAKE2b-256 61dec1444a09160fae3ed4a7fa4dbeb413ee306a70cd939b5b3b67750c6fb668

See more details on using hashes here.

File details

Details for the file PingdomLib3-3.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: PingdomLib3-3.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/36.5.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.10

File hashes

Hashes for PingdomLib3-3.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 296be532edf24de29c2ca7ea909c34aa99dd7895753eade832a852ba7fe2c553
MD5 cf535e552aadbf05ba8cbf2843e2d02c
BLAKE2b-256 e28bda2119a274e5ba5cb9fbdff47fd966c72e5eca9636ab6e1d427f222bf38e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page