Monitoring cronjobs with OhDear made easy! Just register your commands in a service provider.
public function boot(): void
{
OhDearCron::register(TestCommand::class, 'id');
}
You can install the package via composer:
composer require marlonbasten/ohdear-croncheck-laravel
You can publish the config file with:
php artisan vendor:publish --tag="ohdear-croncheck-laravel-config"
This is the contents of the published config file:
return [
// If false, cronjobs will always be sent to OhDear
'only_in_prod' => true,
// The ping URL for OhDear (https://ohdear.app/docs/features/cron-job-monitoring#php)
'ohdear_url' => 'https://ping.ohdear.app',
];
Register the command you want to monitor with OhDear in any service provider using the Facade.
public function boot(): void
{
\Marlonbasten\OhdearCroncheckLaravel\Facades\OhDearCron::register(TestCommand::class, 'id');
}
The id
is the last part of your ping URL you get on OhDear.
That's it! Now every time the command runs, OhDear will receive a ping.
The package will also send the exit code and the runtime of the command to OhDear.
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
This package was inspired by Freek Van der Herten
The MIT License (MIT). Please see License File for more information.