scottrobertson/scrutiny

An agnostic monitoring system written in PHP. You can monitor any service, and report it anywhere (pushover.net for example) it if goes down.

dev-master 2014-02-12 17:14 UTC

This package is not auto-updated.

Last update: 2024-11-05 06:50:40 UTC


README

Build Status Dependency Status Version Downloads

An agnostic monitoring system written in PHP. Monitor any service, and report on it's status.

Each Reporter can subscribe to Events from Services. There are 3 events: up, down, and recovery. Services can collect any meta data they want, and Reporters will have access to this data. This allows you to collect stats for instance.

Install

{
    "require" : {
        "scottrobertson/scrutiny" : "dev-master"
    }
}
<?php
include __DIR__ . '/vendor/autoload.php';
$scrutiny = new \ScottRobertson\Scrutiny\Client();

// Setup Services to monitor
$scrutiny->addService(new \ScottRobertson\Scrutiny\Service\Http('http://example.com'));

// Set options on a service
$mongodb = new \ScottRobertson\Scrutiny\Service\MongoDB();
$mongodb->setName('MongoDB');
$mongodb->setInterval(20);
$mongodb->setDownMessage('ER MER GERD MORGOR ER DORN');
$scrutiny->addService($mongodb);

// Setup Reporters
$scrutiny->addReporter(new \ScottRobertson\Scrutiny\Reporter\Post('http://api.example.com'));
$scrutiny->addReporter(
    new \ScottRobertson\Scrutiny\Reporter\Pushover(
        'token',
        'user'
    )
);

$scrutiny->watch();

Current Services

  • MySQL
  • MongoDB
  • Http (Checking if a website is available)

Current Reporters

  • Pushover.net
  • Post

Example Use case

For example, if you wanted to monitor MySQL, you could setup the Pushover Reporter to subscribe to "down" events. This would mean that if MySQL went down, you would receive a push notification.