Giter Site home page Giter Site logo

airlst / laravel-server-monitor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spatie/laravel-server-monitor

0.0 1.0 0.0 138 KB

Monitor the health of your server

Home Page: https://spatie.be/opensource/laravel

License: MIT License

PHP 97.67% JavaScript 2.06% Shell 0.27%

laravel-server-monitor's Introduction

PACKAGE IN DEVELOPMENT, DO NOT USE YET

An easy to use powerful server monitor

Latest Version on Packagist Build Status SensioLabsInsight Quality Score StyleCI Total Downloads

We all dream over 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.

Using this package you can keep an eye on the health of your server. There are a few checks that come out of the box. Adding new checks is a breeze.

When something goes wrong it can notify via Slack or mail. Behind the scenes Laravel's native notification system is leveraged so you can use one of the many notification drivers.

Postcardware

You're free to use this package (it's MIT-licensed), but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.

The best postcards will get published on the open source page on our website.

Installation

You can install this package via composer using this command:

composer require spatie/laravel-server-monitor

Next, 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\CheckDefiniations\Diskspace::class,
        'beanstalkd' => Spatie\ServerMonitor\CheckDefiniations\Beanstald::class,
    ],

    /*
     * The performance of the package process 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,

    'notifications' => [

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

        'mail' => [
            'to' => '[email protected]',
        ],

        '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 `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,
];

Documentation

The full documentation is available on our documentation site.

Changelog

Please see CHANGELOG for more information what has changed recently.

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

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

About Spatie

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

License

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.