The Home for Magento 2 Excellence

Automated build tests for Magento 2 modules. Explore. Evaluate. Elevate. #magento2

1094 Modules
674 Ready
419 Need Help
Vendors 🏆 Leaderboard
Actively Maintained v1.10.4 MIT

Oh Dear Health Monitoring for Magento 2

vendic/magento2-oh-dear-checks 43

Adds application health monitoring via Oh Dear, shipping with built-in checks for disk space, CPU load, database connections and PHP-FPM, plus a framework for writing custom checks.

10,479
Downloads
Below average
8
GitHub Stars
Below average
12d ago
Last Release
2
Open Issues
Build Passing
Ready to install

Build Tests

Composer Install
DI Compile
Templates

Code Quality

CS Coding Standard
15 warnings
L5 PHPStan

Release Discipline

Follows SemVer · 100% What is this?

Release history audited up to v1.10.4

Tested on Magento 2.4.9

Recent Test History

Each release is tested against the latest Magento version at that time.

v1.10.4 on Magento 2.4.9
Sep 16, 2026
v1.10.3 on Magento 2.4.9
Sep 10, 2026
v1.10.2 on Magento 2.4.9
Sep 9, 2026
v1.10.1 on Magento 2.4.9
Sep 4, 2026
v1.10.0 on Magento 2.4.9
Sep 2, 2026
v1.9.2 on Magento 2.4.9
Jul 21, 2026

+4 older tests

Share This Module's Status

Oh Dear Health Monitoring for Magento 2 Magento compatibility status badge

README

Loaded from GitHub

Oh Dear module for Magento 2

This module adds Application health monitoring using Oh Dear to Magento 2. It allows you to easily write your own custom checks. Additionally, it ships with a number of checks out of the box.

Installation

composer require vendic/magento2-oh-dear-checks

Configuration

Some checks have an optional configuration. You can configure these checks in the env.php. Example:

    'ohdear' => [
        \Vendic\OhDear\Checks\Diskspace::class => [
            'max_percentage_used' => '86'
        ],
        \Vendic\OhDear\Checks\CpuLoad::class => [
            'max_load_last_minute' => 10,
            'max_load_last_five_minutes' => 8,
            'max_load_last_fifteen_minutes' => 6
        ],
        \Vendic\OhDear\Checks\DatabaseConnectionCount::class => [
            'failed_treshold' => 100,
            'warning_treshold' => 80
        ],
        \Vendic\OhDear\Checks\PhpFpmCount::class => [
            'failed_treshold' => 100,
            'warning_treshold' => 80
        ],
    ]

Disabling Checks

To disable any check, add an entry to your env.php with the check class name and set enabled to false:

    'ohdear' => [
        'Vendic\\OhDear\\Checks\\CpuLoad' => [
            'enabled' => false
        ],
        'Vendic\\OhDear\\Checks\\Diskspace' => [
            'enabled' => false
        ],
        'Vendic\\OhDear\\Checks\\TwoFactorAuthentication' => [
             'enabled' => false
        ]
    ],

Checks

TODO

Store fronts

Oh Dear monitors one domain per site, but a single Magento instance often serves many store views on different domains. The store_fronts check reports on the availability of all those child store domains:

  • An hourly cron (vendic_ohdear_check_store_fronts) collects the link URL of every active store view and requests them in parallel with a 10 second timeout, following up to 5 redirects. The link URL respects a store's custom base URL when configured and includes the store code path when "add store code to URLs" is enabled (e.g. https://ivol.test/deurmat24_nl/), so it matches the URLs Magento itself generates. URLs are deduplicated and the default store view is excluded, since Oh Dear already monitors that domain directly.
  • A second cron (vendic_ohdear_recheck_failed_store_fronts) runs every 2 minutes and rechecks only the store fronts that failed during the last sweep, so recoveries and persisting outages are noticed within minutes. It does nothing while everything is up.
  • A store front counts as reachable only when the request ends in an HTTP 200.
  • Only failing URLs are stored and reported. When one or more store fronts are down the check fails and the failed URLs (with their HTTP status or connection error) are attached as meta under failed_urls.
  • The check reports OK when the cron has not produced results yet (e.g. right after a deploy) or when there are no children store fronts to check, and warns when the cached results are older than 2 hours, so a broken cron does not go unnoticed.
  • Status changes go through the CachedStatusResolver (like the PHP-FPM count check): a failure or recovery must persist for the status time threshold (default 5 minutes, configurable via the status_time_treshold check config in env.php) before the reported status flips, which protects against flapping store fronts.

Individual stores can be excluded from the check by listing their store codes in the excluded_stores check config in env.php, and the whole check can be disabled like any other:

    'ohdear' => [
        \Vendic\OhDear\Checks\StoreFronts::class => [
            'enabled' => false,
            'excluded_stores' => ['store_code_one', 'store_code_two']
        ],
    ]

Disabling the check also stops both crons from making any requests.

Write your own checks

  1. Create a new class that implements Vendic\OhDear\Interfaces\CheckInterface, place it in 'Checks'. This class will contain the main logic of your check.
  2. Add your new class to the 'checks' argument of Vendic\OhDear\Api\CheckListInterface
    <type name="Vendic\OhDear\Api\CheckListInterface">
        <arguments>
            <argument name="checks" xsi:type="array">
                ...
                <item name="your_new_check" xsi:type="object">Vendic\OhDear\Checks\YourNewCheck</item>
                ...
            </argument>
        </arguments>
    </type>
  1. Preferabbly add a test for your check. See Vendic\OhDear\Test\Integration\Checks\ for examples.
  2. Test your output on: https://magento2.test/oh-dear-health-application-check-results. Your GET request should include the header oh-dear-health-check-secret. The header value should match the Magento config value of ohdear/health_check/secret. If you don't have this header, you will get a 'No health secret provided' response.
  3. Open a PR with your new check!

This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.