Application Health

Health Check Results

PHP package to construct JSON health check reports for Oh Dear's application health monitoring.

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.