PHP Classes

File: example1.php

Recommend this page to a friend!
  Classes of Paul Aitken   Server Status   example1.php   Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: A simple example of using ServerStatus
Class: Server Status
Checks a server to verify if services are up.
Author: By
Last change: A complete recode, using the new methods.
Date: 16 years ago
Size: 709 bytes


Class file image Download
 * Copyright 2007. Paul Aitken <>
 * Licensed under The GNU General Public License (GPL) Version 2 or greater
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', '', 80);

// Lets check all the status' of the servers that were added

// Lets check the status of 'http-example' (returns true/false)
echo ($status->status('http-example')) ? 'http-example is up' : 'http-example is down';