PHPackages                             jacotheron/forge-monitor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. jacotheron/forge-monitor

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

jacotheron/forge-monitor
========================

A simple package to monitor storage used by sites on a Forge provisioned server. Also monitors database sizes. Sends email with the details after each run.

v1.0.2(3mo ago)019MITPHPPHP ^8.4

Since Mar 16Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Jacotheron/forge-monitor)[ Packagist](https://packagist.org/packages/jacotheron/forge-monitor)[ Docs](https://github.com/Jacotheron/forge-monitor)[ RSS](/packages/jacotheron-forge-monitor/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)Dependencies (13)Versions (4)Used By (0)

A simple package to monitor storage used by sites on a Forge provisioned server. Also monitors database sizes. Sends email with the details after each run.
===========================================================================================================================================================

[](#a-simple-package-to-monitor-storage-used-by-sites-on-a-forge-provisioned-server-also-monitors-database-sizes-sends-email-with-the-details-after-each-run)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f34140cd3e958b79b5510fe3ac3dc972b79c54cc0b741394005241e6bffd4714/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a61636f746865726f6e2f666f7267652d6d6f6e69746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jacotheron/forge-monitor)[![Total Downloads](https://camo.githubusercontent.com/54075544663caf8ce8da00e0b578ef77bf75b2efcd1ddb9ba3b1cd0cff8c18cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a61636f746865726f6e2f666f7267652d6d6f6e69746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jacotheron/forge-monitor)

Easily get notifications of the storage used by sites on a Forge provisioned server including database sizes. Sends email with the details after each run.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require jacotheron/forge-monitor
```

You can publish the config file with:

```
php artisan vendor:publish --tag="forge-monitor-config"
```

This is the contents of the published config file:

```
return [

    /**
     * Commands to run to get disk usage (File system, Disk Size, Used, Available, Use%, Mounted on)
     * This is provided directly to the shell using Symfony/Process component
     * Example: ['df', '-h', '/'] results in "df -h /"
     * Your current user needs to be able to run this command successfully, otherwise to skip this, set to null
     * accepts: array|null
     */
    'disc_commands' => [
        'df',
        '-h',
        '/'
    ],

    /**
     * Disk Command Timeout
     * The command may take a while to complete, depending on the number of files it needs to scan, if you get timeouts, increase this value
     * accepts: int
     */
    'disk_command_timeout' => 1200,

    /**
     * Directory containing all sites/projects to monitor
     * Set to null to skip
     * accepts: string|null
     */
    'projects_location' => '/home/forge',

    /**
     * Commands to run on each directory inside the 'projects_location'
     * This is also provided directly into the shell using Symfony/Process component
     * Example: ['du', '-hs'] runs "du -hs /home/forge/{dir}"
     * Your current user needs to be able to run this command successfully, otherwise to skip this, set to null
     * Directory is automatically added to the command
     * accepts: array|null
     */
    'project_commands' => [
        'du',
        '-hs',
    ],

    /**
     * Project Command Timeout
     * The command may take a while to complete, depending on the number of files it needs to scan, if you get timeouts, increase this value
     * accepts: int
     */
    'project_command_timeout' => 1200,

    /**
     * Also run 'project_commands' on the 'projects_location' directory (results in a "All Projects" entry)
     * accepts: bool
     */
    'project_commands_on_projects_location' => true,

    /**
     * Only run 'project_commands' on the 'projects_location' directory (results in a "All Projects" entry)
     * accepts: bool
     */
    'project_commands_only_on_projects_location' => false,

    /**
     * Enable DB Monitoring (MySQL / MariaDB)
     * Note: Your db user needs to be able to query the 'information_schema' root database.
     * A quick way to handle this, is to duplicate the 'mysql' database driver in the config/database.php file, and setup with a dedicated user,
     * and the database option set to 'information_schema';
     *
     * Value here should be the name of the database driver to use
     *
     * accepts: string|null
     */
    'db_driver' => null,

    /**
     * String outputs for the email/command outputs
     * Use this if you need to handle translations
     * accepts: array
     */
    'strings' => [
        'disk_results' => 'Disk Results:',
        'all_projects' => '(All Projects)',
        'scan_results' => 'Scan Results:',
        'db_results' => 'DB Results:',
        'total' => 'Total',
        'database' => 'Database',
        'size' => 'Size',
        'done' => 'Done',
        'email' => [
            'disk_details' => 'Disk Details:',
            'disk_usage' => 'Disk Usage Results:',
            'db_usage' => 'Database Usage Results:',
            'db' => 'Database',
            'size' => 'Size',
        ],
    ],

    /**
     * Email Recipient
     * Set to_address to null to disable email sending
     * Subject have {date} placeholder
     * accepts array|null
     */
    'email' => [
        'to_address' => null,
        'subject' => 'Forge Monitor Report - {date}',
        'subject_date_format' => 'Y-m-d H:i:s',
    ],

];
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="forge-monitor-views"
```

In order for the command to read database sizes, we need a db connection to the 'information\_schema' database on the server. This can be done by copying the mysql driver in your `config/database.php` file. For example:

```
'information_schema' => [
    'driver' => 'mysql',
    'url' => env('DATABASE_URL'),
    'host' => env('DB_HOST', '127.0.0.1'),
    'port' => env('DB_PORT', '3306'),
    'database' => 'information_schema',
    'username' => env('DB_USERNAME', 'forge'),
    'password' => env('DB_PASSWORD', ''),
    'unix_socket' => env('DB_SOCKET', ''),
    'charset' => 'utf8mb4',
    'collation' => 'utf8mb4_unicode_ci',
    'prefix' => '',
    'prefix_indexes' => true,
    'strict' => true,
    'engine' => null,
    'options' => extension_loaded('pdo_mysql') ? array_filter([
        PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
    ]) : [],
],
```

Note the `database` set to 'information\_schema'; if you want to be more secure, you can create a new user for this purpose, and change the env keys to use the dedicated details.

You can then set the `db_driver` in the config to the name of the new driver you created.

Usage
-----

[](#usage)

Run the command using:

```
php artisan forge-monitor
```

Schedule the command to run at regular intervals by editing your app/Console/Kernel.php file or in newer Laravel versions, routes/console.php file

```
use Illuminate\Support\Facades\Schedule;

Schedule::command('forge-monitor')->dailyAt('00:00');
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Jacotheron](https://github.com/Jacotheron)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Important details
-----------------

[](#important-details)

Global disk usage is default fetched using the command `df -h /` - your current user needs to be able to run this command successfully, otherwise to skip this, set to null in config.

Default project folder is `/home/forge/`.

Project disk usage is fetched using the command `du -hs {project_folder}/{dir}` - your current user needs to be able to run this command successfully, otherwise to skip this, set to null in config.

Currently only 1 project folder is supported; when using isolated sites, this package will be needed on each one you want to monitor, since they are run in different user accounts.

Database size includes both the Data and Index lengths, as stored in the information\_schema database's TABLES table. This package is currently only compatible with MySQL / MariaDB.

This package does not make any changes to the server (no files and databases), it is only a monitoring tool. While I do take security very seriously, and the commands used are quite safe to use, I am not responsible for any damage that may occur due to the use of this package. The commands that are used can be changed in the config file, and a malicious command here can cause damage to the server.

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance88

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

101d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/506751c63c3c39a26b1b52b342160f1a10269515635b75ae2bc92d3a957b907b?d=identicon)[Jacotheron](/maintainers/Jacotheron)

---

Top Contributors

[![Jacotheron](https://avatars.githubusercontent.com/u/1516245?v=4)](https://github.com/Jacotheron "Jacotheron (11 commits)")

---

Tags

laraveljacotheronforge-monitor

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jacotheron-forge-monitor/health.svg)

```
[![Health](https://phpackages.com/badges/jacotheron-forge-monitor/health.svg)](https://phpackages.com/packages/jacotheron-forge-monitor)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M153](/packages/spatie-laravel-health)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.3M42](/packages/spatie-laravel-pdf)[keepsuit/laravel-opentelemetry

OpenTelemetry integration for laravel

162476.0k](/packages/keepsuit-laravel-opentelemetry)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[spatie/laravel-error-share

Share your Laravel errors to Flare

431.3M5](/packages/spatie-laravel-error-share)[tapp/filament-maillog

Filament plugin to view outgoing mail

3063.3k1](/packages/tapp-filament-maillog)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
