PHPackages                             spatie/laravel-server-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. [Mail &amp; Notifications](/categories/mail)
4. /
5. spatie/laravel-server-monitor

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

spatie/laravel-server-monitor
=============================

Monitor servers

1.10.2(4mo ago)844296.4k↑48.2%956MITPHPPHP ^8.2CI passing

Since Feb 20Pushed 4mo ago20 watchersCompare

[ Source](https://github.com/spatie/laravel-server-monitor)[ Packagist](https://packagist.org/packages/spatie/laravel-server-monitor)[ Docs](https://github.com/spatie/laravel-server-monitor)[ GitHub Sponsors](https://github.com/spatie)[ RSS](/packages/spatie-laravel-server-monitor/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (8)Versions (44)Used By (6)

 [   ![Logo for laravel-server-monitor](https://camo.githubusercontent.com/b576d3de0a4468a50a45a748f41d9888a9754801f029ecfdf28ec3cf927fe064/68747470733a2f2f7370617469652e62652f7061636b616765732f6865616465722f6c61726176656c2d7365727665722d6d6f6e69746f722f68746d6c2f6c696768742e77656270)  ](https://spatie.be/open-source?utm_source=github&utm_medium=banner&utm_campaign=laravel-server-monitor)Simple and powerful server monitoring
=====================================

[](#simple-and-powerful-server-monitoring)

[![Latest Version on Packagist](https://camo.githubusercontent.com/72b63603e20f4b5ebfd507273daec3c8736ccfb2c575301382037e0bd925aca1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6c61726176656c2d7365727665722d6d6f6e69746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-server-monitor)[![run-tests](https://github.com/spatie/laravel-server-monitor/actions/workflows/run-tests.yml/badge.svg)](https://github.com/spatie/laravel-server-monitor/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/031bcce89873e039c53f50428eacf5efa2303dd266147564c0baa0a72e57e8f0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d7365727665722d6d6f6e69746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-server-monitor)

We all dream of servers that need no maintenance at all. But unfortunately in reality this is not the case. Disks can get full, processes can crash, the server can run out of memory...

This package keeps an eye on the health of all your servers. There are a few [checks that come out of the box](https://docs.spatie.be/laravel-server-monitor/v1/monitoring-basics/built-in-checks). [Adding new checks](https://docs.spatie.be/laravel-server-monitor/v1/monitoring-basics/writing-your-own-checks) is a breeze.

When something goes wrong it can [notify you](https://docs.spatie.be/laravel-server-monitor/v1/monitoring-basics/notifications-and-events) via Slack or mail.

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/2dc89f9fe97801e986af193b43c49af7e01c6462518aec614511f251c6f2bc4c/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d7365727665722d6d6f6e69746f722e6a70673f743d31)](https://spatie.be/github-ad-click/laravel-server-monitor)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Documentation
-------------

[](#documentation)

The full documentation is available on [our documentation site](https://docs.spatie.be/laravel-server-monitor).

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

[](#installation)

You can install this package via composer using this command:

```
composer require spatie/laravel-server-monitor
```

In Laravel 5.5 the service provider will automatically get registered. In older versions of the framework, you must install the service provider:

```
// config/app.php
'providers' => [
    ...
    Spatie\ServerMonitor\ServerMonitorServiceProvider::class,
];
```

You can publish the migrations with:

```
php artisan vendor:publish --provider="Spatie\ServerMonitor\ServerMonitorServiceProvider" --tag="migrations"
```

After the migration has been published you can create the `hosts` and `checks `tables by running the migrations:

```
php artisan migrate
```

You must publish the config-file with:

```
php artisan vendor:publish --provider="Spatie\ServerMonitor\ServerMonitorServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
return [

    /*
     * These are the checks that can be performed on your servers. You can add your own
     * checks. The only requirement is that they should extend the
     * `Spatie\ServerMonitor\Checks\CheckDefinitions\CheckDefinition` class.
     */
    'checks' => [
        'diskspace' => Spatie\ServerMonitor\CheckDefinitions\Diskspace::class,
        'elasticsearch' => Spatie\ServerMonitor\CheckDefinitions\Elasticsearch::class,
        'memcached' => Spatie\ServerMonitor\CheckDefinitions\Memcached::class,
        'mysql' => Spatie\ServerMonitor\CheckDefinitions\MySql::class,
    ],

    /*
     * The performance of the package can be increased by allowing a high number
     * of concurrent ssh connections. Set this to a lower value if you're
     * getting weird errors running the check.
     */
    'concurrent_ssh_connections' => 5,

    /*
     * This string will be appended to the ssh command generated by the package.
     */
    'ssh_command_suffix' => '',

    'notifications' => [

        'notifications' => [
            Spatie\ServerMonitor\Notifications\Notifications\CheckSucceeded::class => [],
            Spatie\ServerMonitor\Notifications\Notifications\CheckRestored::class => ['slack'],
            Spatie\ServerMonitor\Notifications\Notifications\CheckWarning::class => ['slack'],
            Spatie\ServerMonitor\Notifications\Notifications\CheckFailed::class => ['slack'],
        ],

        /*
         * To avoid burying you in notifications, we'll only send one every given amount
         * of minutes when a check keeps emitting warning or keeps failing.
         */
        'throttle_failing_notifications_for_minutes' => 60,

        'mail' => [
            'to' => 'your@email.com',
        ],

        'slack' => [
            'webhook_url' => env('SERVER_MONITOR_SLACK_WEBHOOK_URL'),
        ],

        /*
         * Here you can specify the notifiable to which the notifications should be sent. The default
         * notifiable will use the variables specified in this config file.
         */
        'notifiable' => \Spatie\ServerMonitor\Notifications\Notifiable::class,

        /*
         * The date format used in notifications.
         */
        'date_format' => 'd/m/Y',
    ],

    /*
     * To add or modify behaviour to the `Host` model you can specify your
     * own model here. The only requirement is that they should
     * extend the `Host` model provided by this package.
     */
    'host_model' => Spatie\ServerMonitor\Models\Host::class,

    /*
     * To add or modify behaviour to the `Check` model you can specify your
     * own model here. The only requirement is that they should
     * extend the `Check` model provided by this package.
     */
    'check_model' => Spatie\ServerMonitor\Models\Check::class,

    /*
     * Right before running a check its process will be given to this class. Here you
     * can perform some last minute manipulations on it before it will
     * actually be run.
     *
     * This class should implement Spatie\ServerMonitor\Manipulators\Manipulator
     */
    'process_manipulator' => Spatie\ServerMonitor\Manipulators\Passthrough::class,

    /*
     * Thresholds for disk space's alert.
     */
    'diskspace_percentage_threshold' => [
        'warning' => 80,
        'fail' => 90,
    ],
];
```

Need a UI?
----------

[](#need-a-ui)

The package doesn't come with any screens out of the box. You may use the [Nova package by @paras-malhotra](https://github.com/insenseanalytics/nova-server-monitor) for monitoring servers on [Laravel Nova](https://nova.laravel.com).

Changelog
---------

[](#changelog)

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

Testing
-------

[](#testing)

To run the tests you'll have to start the included node based dummy ssh server first in a separate terminal window.

```
cd tests/server
npm install
./start_server.sh
```

With the server running, you can start testing.

```
vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you've found a bug regarding security please mail  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

The code to execute commands on a remote server was copied from [Envoy](https://github.com/laravel/envoy).

License
-------

[](#license)

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

###  Health Score

69

—

FairBetter than 100% of packages

Maintenance76

Regular maintenance activity

Popularity58

Moderate usage in the ecosystem

Community39

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 70.7% 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 ~80 days

Recently: every ~273 days

Total

42

Last Release

132d ago

Major Versions

0.1.0 → 1.0.02017-03-01

PHP version history (6 changes)0.0.1PHP ^7.1

1.7.0PHP ^7.2

1.9.2PHP ^7.3

1.9.3PHP ^7.3|^8.0

1.9.5PHP ^8.0

1.10.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (292 commits)")[![r3wald](https://avatars.githubusercontent.com/u/190202?v=4)](https://github.com/r3wald "r3wald (21 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (20 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (11 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (11 commits)")[![AyoobMH](https://avatars.githubusercontent.com/u/37803924?v=4)](https://github.com/AyoobMH "AyoobMH (6 commits)")[![paras-malhotra](https://avatars.githubusercontent.com/u/16099046?v=4)](https://github.com/paras-malhotra "paras-malhotra (5 commits)")[![matt-croft](https://avatars.githubusercontent.com/u/11648395?v=4)](https://github.com/matt-croft "matt-croft (4 commits)")[![jimirobaer](https://avatars.githubusercontent.com/u/8984769?v=4)](https://github.com/jimirobaer "jimirobaer (4 commits)")[![RogierW](https://avatars.githubusercontent.com/u/9381528?v=4)](https://github.com/RogierW "RogierW (4 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (4 commits)")[![Tjitse-E](https://avatars.githubusercontent.com/u/14849044?v=4)](https://github.com/Tjitse-E "Tjitse-E (4 commits)")[![WouterBrouwers](https://avatars.githubusercontent.com/u/40539118?v=4)](https://github.com/WouterBrouwers "WouterBrouwers (3 commits)")[![vdbelt](https://avatars.githubusercontent.com/u/11087503?v=4)](https://github.com/vdbelt "vdbelt (2 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (2 commits)")[![eugenefvdm](https://avatars.githubusercontent.com/u/1836436?v=4)](https://github.com/eugenefvdm "eugenefvdm (2 commits)")[![DieterHolvoet](https://avatars.githubusercontent.com/u/3606531?v=4)](https://github.com/DieterHolvoet "DieterHolvoet (2 commits)")[![m-bosch](https://avatars.githubusercontent.com/u/16580113?v=4)](https://github.com/m-bosch "m-bosch (2 commits)")[![akoepcke](https://avatars.githubusercontent.com/u/5311185?v=4)](https://github.com/akoepcke "akoepcke (2 commits)")[![ptondereau](https://avatars.githubusercontent.com/u/4287777?v=4)](https://github.com/ptondereau "ptondereau (2 commits)")

---

Tags

devopslaravelmonitornotificationsphpserverspatielaravel-server-monitor

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/spatie-laravel-server-monitor/health.svg)

```
[![Health](https://phpackages.com/badges/spatie-laravel-server-monitor/health.svg)](https://phpackages.com/packages/spatie-laravel-server-monitor)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M164](/packages/spatie-laravel-health)[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M222](/packages/backpack-crud)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M984](/packages/statamic-cms)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)

PHPackages © 2026

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