[ All integrations ](https://ohdear.app/third-party-integrations)

# Magento 2 Package

Apply Oh Dear health checks to your Magento 2 applications with pre-built and custom checks.

[ Vendic/magento2-oh-dear ](https://github.com/Vendic/magento2-oh-dear)

by [ Vendic ](https://vendic.nl/)

This Composer package integrates Oh Dear's application health monitoring with Magento 2 stores. It provides pre-built health checks and makes it easy to create custom ones.

## Installation [\#](#installation)

```
<span class="hl-keyword">composer</span> require vendic/magento2-oh-dear-checks
```

## Pre-built Health Checks [\#](#pre-built-health-checks)

The package includes several ready-to-use checks:

- **Disk Space**: Monitor available storage with configurable thresholds
- **CPU Load**: Track system load at 1, 5, and 15-minute intervals
- **Database Connections**: Alert on connection pool exhaustion
- **PHP-FPM Processes**: Monitor PHP process counts
- **Two-Factor Authentication**: Verify 2FA status

## Configuration [\#](#configuration)

Customize checks in your `env.php`:

```
<span class="hl-value">'oh_dear'</span> => [
    <span class="hl-value">'diskspace'</span> => [<span class="hl-value">'max_percentage'</span> => 86],
    <span class="hl-value">'cpu_load'</span> => [
        <span class="hl-value">'max_load_1m'</span> => 2.5,
        <span class="hl-value">'max_load_5m'</span> => 2.0,
        <span class="hl-value">'max_load_15m'</span> => 1.5,
    ],
],
```

Disable any check by adding `'enabled' => false`.

## Custom Health Checks [\#](#custom-health-checks)

Create your own checks by implementing `Vendic\OhDear\Interfaces\CheckInterface` and registering them in the configuration. The package includes integration tests as examples.

## Endpoint [\#](#endpoint)

Health check results are available at `/oh-dear-health-application-check-results` (requires the secret header configured in Oh Dear).

For full documentation and source code, see the [GitHub repository](https://github.com/Vendic/magento2-oh-dear).
