Laravel Stethoscope is a Laravel package to monitor CPU, memory, hard disk, web server, and network connection. You can use this package to provide configurable thresholds for CPU, memory, and hard disk space and continuously monitor those thresholds to trigger alerts.
The package's main features include the following:
- Monitor CPU usage percentage
- Monitor memory usage percentage
- Monitor hard disk free space
- Check network connection status
- Check Nginx status
- Record log when exceeding the consumption CPU, memory, and hard disk of thresholds
- Record log when the network connection fails, or Nginx deactivated
This package comes with a few helpful artisan commands to quickly diagnose useful health metrics. For example, the listen
command will show you the current stats for the configured metrics:
$ php artisan stethoscope:listen2023-01-26 02:27:43cpu usage ===> 0.00%memory usage ===> 0.00%network connection status ===> connectedweb server status ===> web server statushard disk free space ===> 46330949632 Byte (43.15 GB)
You can continuously monitor configured stats and run them on a cron using the monitor
command:
$ php artisan stethoscope:monitor
This package is available on Composer, and the source code is in GitHub. It supports PHP 8+ and Laravel 8+. You can add it to your application with the following:
composer require mohsenabrishami/stethoscope
0 comments:
Post a Comment
Thanks