Skip to main content

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

Metadata

Release files for PingdomLib 2.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PingdomLib 2.0.3
File Size Uploaded Provenance
PingdomLib-2.0.3.tar.gz 18.1 kB Without provenance Details

Release files / PingdomLib-2.0.3.tar.gz

Download URL PingdomLib-2.0.3.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
233648db2d0a339f505959cfd56cef973d1d882af0e127166ca90382c56f590f
BLAKE2b-256 checksum
How to use checksums
13039bd6855caa9c131a26b86617befbab56a31f1d54eccc1234eab21996735a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for PingdomLib 2.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page