ohdearapp/health-check-results 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ohdearapp/health-check-results

最新稳定版本:1.0.3

Composer 安装命令:

composer require ohdearapp/health-check-results

包简介

Create application health check results for Oh Dear

README 文档

README

Latest Version on Packagist Tests Total Downloads

Using Oh Dear you can monitor various aspects or your application and server. This way 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 in a small timeframe (via Flare)
  • a reboot of your app is required
  • ...

You can monitor any aspect of your app that you want.

Using this package you can build up the JSON that Oh Dear expects for its health check.

To learn more head over to the Application Health Monitoring docs at Oh Dear.

Installation

You can install the package via composer:

composer require ohdearapp/health-check-results

Usage

Here's an example that shows how you can create the JSON that Oh Dear expects for the health check.

$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 this JSON:

{
    "finishedAt": 1609459200,
    "checkResults": [
        {
            "name": "UsedDiskSpace",
            "label": "Used disk space",
            "notificationMessage": "Your disk is almost full (91%)",
            "shortSummary": "91%",
            "status": "failed",
            "meta": {
                "used_disk_space_percentage": 91
            }
        }
    ]
}

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 158.07k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 10
  • 点击次数: 2
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固