PHPackages                             php-probe/php-probe - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. php-probe/php-probe

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

php-probe/php-probe
===================

PHP library allowing to simply probe/monitor any applications and services.

0.2(12y ago)7582[1 PRs](https://github.com/michael-bouvy/php-probe/pulls)MITPHPPHP &gt;=5.4.0

Since Jan 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/michael-bouvy/php-probe)[ Packagist](https://packagist.org/packages/php-probe/php-probe)[ RSS](/packages/php-probe-php-probe/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (5)Versions (6)Used By (0)

PhpProbe
========

[](#phpprobe)

PhpProbe is a PHP library allowing to simply probe/monitor any applications and services, and either print results or use them in code.

Also, PhpProbe respects PSR-0/1/2 and PSR-3, meaning (among others) it can be used with any [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md) compliant logger (see `setLogger()` on `Probe`s) like [Monolog](https://github.com/Seldaek/monolog).

Note that this library (especially because it's *only* a library) is not intended to be used instead of monitoring tools like Nagios, which already do the job.

Here's an example what you can simply do with PhpProbe and a few lines of code (see [php-probe-webapp](https://github.com/michael-bouvy/php-probe-webapp) for sources):

[![Screenshot](https://raw.githubusercontent.com/michael-bouvy/php-probe-webapp/master/screenshot.png "PhpProbe webapp screenshot")](https://raw.githubusercontent.com/michael-bouvy/php-probe-webapp/master/screenshot.png)

Core concepts
-------------

[](#core-concepts)

A `Probe` (eg. Tcp, Http, Database) relies on a (compatible) `Adapter` (eg. Netcat, PhpCurl, PhpMysql), which will return an `AdapterResponse`, possibly containing data to test/check.

At this point a `Probe` is considered successful if it could run successfuly (eq. TCP connection established).

You can also add one or more `Check` to check for specific conditions (eg. response time below a given value, HTTP response code ...).

Any PSR-3 compliant logger can also be attached to a `Probe`,(as [Monolog](https://github.com/Seldaek/monolog)), to be warned any error happening, by email for example. Monolog is shipped with several handlers that will certainly fit your needs. Each `Check` can have a defined log level, and therefore be handled by specific handlers.

Usage
-----

[](#usage)

There are 2 ways this library can be used:

#### Standalone mode

[](#standalone-mode)

```
