Download the PHP package jeffersonsimaogoncalves/cakephp-server-monitor without Composer
On this page you can find all versions of the php package jeffersonsimaogoncalves/cakephp-server-monitor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jeffersonsimaogoncalves/cakephp-server-monitor
More information about jeffersonsimaogoncalves/cakephp-server-monitor
Files in jeffersonsimaogoncalves/cakephp-server-monitor
Package cakephp-server-monitor
Short Description Server Monitor built with CakePHP 3
License MIT
Informations about the package cakephp-server-monitor
CakeServerMonitor
CakePHP 3 Plugin for Monitoring Server Stats
Installation
-
To install the CakeServerMonitor plugin, you can use composer. From your application's ROOT directory (where composer.json file is located) run the following:
- You will need to add the following line to your application's
config/bootstrap.php
file:
Notification
CakeServerMonitor currently supports notification via email. You can configure recipients' email addresses in your applications 'config/bootstrap.php' file using overwriting the CakeServerMonitor.email.recipients key:
Scheduling task
The last step to make this work is to add a cron job. You can do so by adding a similar line as shown below to your system's crontab file. Do remember to update the path to your own project. The following cron job runs at 1 am every day, you can change it to your own preference.
* 1 * * * cd path && bin/cake monitor run
Customisation
CakeServerMonitor does provide some customisation options.
- Changing email profile
by default CakeServerMonitor uses the default profile to send an email. You can change it to your own preference using the CakeServerMonitor.email.profile key:
- Changing checking stats
by default CakeServerMonitor checks following stats:
- Disk Space
- MySql Process
- Nginx Process
Under the hood, each checker is actually a class under JeffersonSimaoGoncalves namespace. You can overwrite what checkers to run via the CakeServerMonitor.commands key:
You can remove any checkers above so it won't run.
- Creating your own checker
As you might have already guessed, you can create your own checker to extend CakeServerMonitor's abilities. To do so, creates a class extends from JeffersonSimaoGoncalves\CakeServerMonitor\CommandDefinition\CommandDefinition abstract class and implement its defined abstract methods.
After that, add your own checker to the CakeServerMonitor.commands key as shown in previous section.
Helper methods
To view current server stats:
bin/cake monitor view
Credits
This work is fork on the code by watchowl.