mohsenabrishami/stethoscope
Monitor your Laravel server’s health with CPU, memory, disk space, network, and web server (Nginx/Apache) checks. Logs threshold breaches and failures, and can email alerts when issues occur. Linux-based, PHP 8+ and Laravel 8+.
Start by installing the package via Composer and publishing its configuration:
composer require mohsenabrishami/stethoscope
php artisan vendor:publish --tag=stethoscope-publish-config
The package targets Linux servers (Debian/Ubuntu family) and requires PHP 8.0+ and Laravel 8+. After configuration, run php artisan stethoscope:listen to get an immediate server health snapshot — this outputs CPU, memory, storage, network, and web server status in a human-friendly CLI table. For basic proactive monitoring, use php artisan stethoscope:monitor, which checks thresholds and logs issues.
stethoscope:monitor command every 5 minutes in your kernel to keep logs updated:
$schedule->command('stethoscope:monitor')->everyFiveMinutes();
'drivers' => ['log_record' => 'database'] in config/stethoscope.php, then run php artisan migrate. Database logs are essential for dashboard use.status: true, path: 'monitoring-panel') and publish views with --tag=stethoscope-publish-view. Protect it with a secret key (e.g., ?key=xyz) and ensure MONITORING_PANEL_KEY is set in .env.LogReportNotification and Notifiable to plug in Telegram, Slack, or custom endpoints. Register your custom notification class in config/stethoscope.php under notifications.top, df, free). The package will fail or show inaccurate readings on Windows/macOS unless run via WSL or similar.cpu: 90, memory: 80, storage: 10 GB free) may be too aggressive or too lenient depending on your workload. Tune them in .env to prevent notification storms or missed alerts.https://1.1.1.1 and https://www.google.com. Ensure both are reachable; if your environment blocks external domains, update network_monitor_url to internal endpoints.php artisan stethoscope:clean regularly (e.g., daily cron job) to prevent log bloat — especially important when using database storage. Check cleanup_resource_logs in config.StethoscopeNotifiable and LogReportNotification to inject custom logic. Hook into the MonitorFinished event (if available in future versions) or override the monitor() command logic via command subclassing.How can I help you explore Laravel packages today?