Recommend this page to a friend! |
Download .zip |
Info | Documentation | Screenshots | View files (29) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2020-08-16 (13 days ago) | Not yet rated by the users | Total: 41 This week: 5 | All time: 9,904 This week: 47 |
Version | License | PHP version | Categories | |||
laravel-uptime 1.0 | The PHP License | 5 | PHP 5, System information, Web services |
Description | Author | |
This package can monitor servers to verify if they are responding. |
Keep track of critical endpoints with this command-line uptime monitor. Add an endpoint, set a frequency and listen to an event if something goes down.
<p align="center"><img src="https://raw.githubusercontent.com/infinitypaul/laravel-uptime/master/screen.jpeg" /></p>
You can install the package via composer:
composer require infinitypaul/laravel-uptime
To publish Uptime's configuration and migration files, run the vendor:publish command.
php artisan vendor:publish --provider="Infinitypaul\LaravelUptime\LaravelUptimeServiceProvider"
This will create a uptime.php in your config directory. The default configuration should work just fine for you, but you can take a look at it, if you want to customize the table / model names Uptime will use
Run the migration command, to generate all tables needed for Uptime.
php artisan migrate
After the migration, 2 new tables will be created: * endpoints - stores endpoint records * statuses - store the ping status of the endpoint
Once Package is Installed, The Following Commands Will Be Available To You
| Command | Descriptions | Argument | Options |----------|:-------------:|------:|------:| | endpoint:add | Add An Endpoint To Monitor | url eg: https://infinitypaul.com | Frequency in Minutes eg 20, default is 5 | | endpoint:remove | Remove An Endpoint | id of the end endpoint eg 2 | null | | uptime:status | Display The Status Of All Endpoint | null | force : check for the status of the endpoint and display as well | uptime:run | Run The Whole Endpoint To Get Status | null | force : get an immediate response of the endpoint irrespective of the minutes
php artisan endpoint:add https://infinitypaul.com -f 5
Add Infinitypaul.com as a frequency of 5
php artisan endpoint:add own -f 5
Add The Base URL of your laravel project
php artisan uptime:status
Display All the Endpoint And Status In A Beautiful Table
php artisan uptime:status --force
Check The Status Of The Endpoint Irrespective Of Their Frequency And Display As Well
php artisan endpoint:remove
Remove An Endpoint From The List Of EndPoint To Be Monitored
php artisan uptime:run
Ping All The Endpoint And Get The Up Or Down Status In Order Of Their Frequency
php artisan uptime:run --force
Ping All The Endpoint And Get The Up Or Down Status Irrespective Of Their Frequency
You can add the run command in your task scheduling to run every minute
php artisan uptime:run
If you need to run additional processes when an endpoint is down or back up, you can Listen for these events:
\Infinitypaul\LaravelUptime\Events\EndpointIsBackUp
\Infinitypaul\LaravelUptime\Events\EndpointIsDown
In your EventServiceProvider
add your listener(s):
/
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
...
\Infinitypaul\LaravelUptime\Events\EndpointIsBackUp::class => [
App\Listeners\URLIsBack::class,
],
\Infinitypaul\LaravelUptime\Events\EndpointIsDown::class => [
App\Listeners\YourEndPointIsDown::class,
],
];
The EndpointIsBackUp and EndpointIsDown event exposes the Endpoint and Status. In your listener, you can access them like so:
<?php
namespace App\Listeners;
use Infinitypaul\LaravelUptime\Events\EndpointIsBackUp;
class URLIsBack
{
/
* Create the event listener.
*
* @return void
*/
public function __construct()
{
//
}
/
* Handle the event.
*
* @param EndpointIsBackUp $event
* @return void
*/
public function handle(EndpointIsBackUp $event)
{
// $endpointStatus = $event->getEndpointStatus();
// $EndpointDetails = $event->getEndpoint();
// Do something with the Endpoint and Status.
}
}
Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!
Don't forget to follow me on twitter!
Thanks! Edward Paul.
The MIT License (MIT). Please see License File for more information.
Screenshots | ||
Files |
File | Role | Description | ||
---|---|---|---|---|
config (1 file) | ||||
database (1 directory) | ||||
src (5 files, 4 directories) | ||||
tests (1 file) | ||||
.editorconfig | Data | Auxiliary data | ||
.scrutinizer.yml | Data | Auxiliary data | ||
.styleci.yml | Data | Auxiliary data | ||
.travis.yml | Data | Auxiliary data | ||
CHANGELOG.md | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
CONTRIBUTING.md | Data | Auxiliary data | ||
LICENSE.md | Lic. | License text | ||
phpunit.xml.dist | Data | Auxiliary data | ||
README.md | Doc. | Read me |
Files | / | database | / | migrations |
File | Role | Description |
---|---|---|
2016_05_18_000000_...me_setup_tables.php | Class | Class source |
Files | / | src |
File | Role | Description | ||
---|---|---|---|---|
Commands (4 files, 1 directory) | ||||
Events (2 files) | ||||
Scheduler (3 files) | ||||
Tasks (1 file) | ||||
Endpoint.php | Class | Class source | ||
LaravelUptime.php | Class | Class source | ||
LaravelUptimeFacade.php | Class | Class source | ||
LaravelUptimeServiceProvider.php | Class | Class source | ||
Status.php | Class | Class source |
Files | / | src | / | Commands |
File | Role | Description | ||
---|---|---|---|---|
Traits (1 file) | ||||
AddEndPoint.php | Class | Class source | ||
RemoveEndPoints.php | Class | Class source | ||
Run.php | Class | Class source | ||
Status.php | Class | Class source |
Files | / | src | / | Events |
File | Role | Description |
---|---|---|
EndpointIsBackUp.php | Class | Class source |
EndpointIsDown.php | Class | Class source |
Files | / | src | / | Scheduler |
File | Role | Description |
---|---|---|
Frequencies.php | Class | Class source |
Kernel.php | Class | Class source |
Task.php | Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.