2017 © Pedro Peláez
 

library laravel-server-monitor-plugin-notification-by-host

Monitor servers plugin to send notification by host

image

thecodingmachine/laravel-server-monitor-plugin-notification-by-host

Monitor servers plugin to send notification by host

  • Wednesday, December 27, 2017
  • by thecodingmachine
  • Repository
  • 6 Watchers
  • 0 Stars
  • 14 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Scrutinizer Code Quality Build Status Coverage Status, (*1)

Plugin to Laravel server Monitor

This plugin is to use a different notification way by host for the Laravel server monitor developed by spatie, (*2)

Installation

You can install this package via composer using this command:, (*3)

composer require spatie/laravel-server-monitor

Next, you must install the service provider:, (*4)

// config/app.php
'providers' => [
    ...
    TheCodingMachine\ServerMonitorPluginNotificationbyHost\ServerMonitorPluginNotificationByHostServiceProvider::class,
];

You must publish the config-file with:, (*5)

php artisan vendor:publish --provider="TheCodingMachine\ServerMonitorPluginNotificationbyHost\ServerMonitorPluginNotificationByHostServiceProvider" --tag="config"

This is the contents of the published config file:, (*6)

return [
    'notifications' => [
        /* List of each channel you can be used */
        /* This contain the detail of parameter mandatory to use it */
        'channels' => 
            ['mail' => 
                ['to' => 'array']],
            ['slack' => 
                ['webhook_url' => 'string']],

    ]
];

To use the plugin, you must change the server-monitor.php with the next values:, (*7)

    ...

    'notifications' => [

        'notifications' => [
            TheCodingMachine\ServerMonitorPluginNotificationByHost\Notifications\Notifications\CheckSucceeded::class => [],
            TheCodingMachine\ServerMonitorPluginNotificationByHost\Notifications\Notifications\CheckRestored::class => ['slack'],
            TheCodingMachine\ServerMonitorPluginNotificationByHost\Notifications\Notifications\CheckWarning::class => ['slack'],
            TheCodingMachine\ServerMonitorPluginNotificationByHost\Notifications\Notifications\CheckFailed::class => ['slack'],
        ],
        ...
        'notifiable' => TheCodingMachine\ServerMonitorPluginNotificationByHost\Notifications\Notifiable::class,
        ...
    ]
    ...

Use it

By default, if no custom configuration was configured, this is the global parameters set in server-monitor.php which will used. You can change the configuration by host (mail receiver, slack channel ...), and the channel by error type by host., (*8)

To apply this, there is 2 new commands add to artisan: - Add notification for a specific host: php artisan server-monitor:add-notification-host - List all notification by host: php artisan server-monitor:list-notifications, (*9)

The Versions

27/12 2017

dev-master

9999999-dev https://github.com/thecodingmachine/laravel-server-monitor-plugin-notification-by-host

Monitor servers plugin to send notification by host

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin notification spatie laravel-server-monitor

27/12 2017
14/12 2017

0.1

0.1.0.0 https://github.com/thecodingmachine/laravel-server-monitor-plugin-notification-by-host

Monitor servers plugin to send notification by host

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin notification spatie laravel-server-monitor