Oh Dear
Application Health

Health Check Results PHP Package for Oh Dear

PHP package that builds the JSON Oh Dear needs for Application Health monitoring, so you get alerts on low disk space, a down database, Redis and more.

Build Health Check Reports for Any PHP Application #

Using Oh Dear you can monitor various aspects of your application and server. The health-check-results package helps you build the JSON structure that Oh Dear expects for its Application Health monitoring feature.

What You Can Monitor #

With this package and Oh Dear's Application Health monitoring, you could get alerts when:

Installation #

Install via Composer:

composer require ohdearapp/health-check-results

Usage #

Create health check results with specific statuses:

$checkResults = new CheckResults(DateTime::createFromFormat('Y-m-d H:i:s', '2021-01-01 00:00:00'));

$checkResult = new CheckResult(
    name: 'UsedDiskSpace',
    label: 'Used disk space',
    notificationMessage: 'Your disk is almost full (91%)',
    shortSummary: '91%',
    status: CheckResult::STATUS_FAILED,
    meta: ['used_disk_space_percentage' => 91]
);

$checkResults->addCheckResult($checkResult);

This will output the JSON structure that Oh Dear expects, enabling you to monitor any aspect of your application you need.