<?php
/**
* Copyright 2007. Paul Aitken <http://justletitflow.com>
* Licensed under The GNU General Public License (GPL) Version 2 or greater
* http://www.opensource.org/licenses/gpl-license.html
*/
require_once 'server_status.php';
// Create new instance of the class ServerStatus
$status = new ServerStatus();
// Lets add an example site to check - first parameter must be unique for each service
$status->add('http-example', 'example.com', 80);
// Lets check all the status' of the servers that were added
$status->check();
// Lets check the status of 'http-example' (returns true/false)
echo ($status->status('http-example')) ? 'http-example is up' : 'http-example is down';
?>
|