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:
- Disk space is running low
- The database is down
- Redis cannot be reached
- Mails cannot be sent
- There are many application errors (via Flare integration)
- A reboot of your app is required
- Any custom health check you define fails
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.