nkeenan38/phpingdom

This package is abandoned and no longer maintained. No replacement package was suggested.

A PHP library for the Pingdom API

1.0.2 2020-06-01 18:26 UTC

This package is auto-updated.

Last update: 2024-03-29 04:12:31 UTC


README

A PHP library for the Pingdom API.

Installation

Install the library using composer by adding the following to composer.json in the root of your project:

{ 
    "require": {
        "nkeenan38/phppingdom": "1.0.*"
    }
}

Use the generated vendor/.composer/autoload.php file to autoload the library classes.

Basic usage

You will need a Pingdom application key for authorizatioon. Follow their documentation to generate an application key inside the Pingdom control panel.

<?php

$token    = ''; // Pingdom application key (32 characters)

$pingdom = new \Pingdom\Client($token);

// List of probe servers
$probes = $pingdom->getProbes();
foreach ($probes as $probe) {
    echo $probe->getName() . PHP_EOL;
}

// List of checks
$checks  = $pingdom->getChecks();
foreach ($checks as $check) {
    $results = $pingdom->getResults($check['id']);
}