Extra Checks for Laravel Server Monitor


June 2nd, 2023

Extra Checks for Laravel Server Monitor

If you want to add some additional server checks for Spatie's Laravel Server Monitor Package, check out this extra server monitor checks package. At its core, Laravel Server monitor runs using Laravel's built-in scheduler, running every minute to see what checks must be done. If any checks fail, the package will notify you via the notification channel of your choice.

This specific package provides extra custom checks beyond the checks that ship with Laravel Server monitor, including:

  • CPU Load check
  • Redis process check to ensure the process is running
  • Redis memory check to validate acceptable thresholds
  • Horizon command check to make sure the Artisan command is running
  • Ensure the Horizon supervisord process is running
  • Horizon worker check
  • Queue worker check
  • DB connection count check

As an example, you can provide the following configuration when using the CPU load check:

'cpu_load' => [
'one_minute_threshold' => 1.6,
'five_minute_threshold' => 1.2,
'fifteen_minute_threshold' => 1.1,

And here's another example for the horizon checks:

'horizon' => [
'artisan_command_processes' => 1,
'supervisor_processes' => 1,
'min_worker_processes' => 1,
'max_worker_processes' => 1,

If you'd like to add your own custom checks to Laravel Server Monitor, check out the documentation on Writing your own checks .

If you'd like to use the extra checks in this package, you can find the documentation, get full installation instructions, and view the source code on GitHub.

Filed in:

Paul Redmond

Full stack web developer. Author of Lumen Programming Guide and Docker for PHP Developers.