- Can I use spatie/server-monitor-app with Laravel 8 or 9?
- No, this package is built on Laravel 5.4 and won’t work with newer Laravel versions. For modern Laravel stacks, consider alternatives like `spatie/laravel-health` or standalone `laravel-server-monitor` with a custom UI.
- How do I install this package for monitoring multiple servers?
- Run `composer create-project spatie/server-monitor-app <project-name>` to install the full Laravel 5.4 app. Configure servers in the `.env` file or database, then set up checks via the built-in admin panel or CLI commands.
- What PHP versions does this package support?
- The package officially supports PHP 7.1–7.4. PHP 8.x may break compatibility due to changes in functions like `array_column` or `json_decode`. Test thoroughly if upgrading.
- How do I add custom server checks (e.g., database latency, API response time)?
- Extend the package by creating custom checks using Laravel’s service providers. Override the `Check` class or register new checks via the `ChecksServiceProvider`. Document your logic in the `run()` method of your custom check class.
- Will this work in production with high server loads (e.g., 100+ servers)?
- The package isn’t optimized for large-scale deployments. For 100+ servers, use async processing with Laravel queues or migrate to a dedicated monitoring solution like Prometheus or Upptime. Containerize the app to isolate resource usage.
- How do I configure Slack or email notifications for alerts?
- Set up notifications in the `.env` file with `SLACK_WEBHOOK_URL` or `MAIL_*` credentials. Customize alert templates in `resources/views/notifications/`. Use Laravel’s event system to extend or override default notification logic.
- Is there a way to run this without the Laravel admin panel (headless mode)?
- Yes, you can disable the admin panel by removing its routes in `routes/web.php` and rely solely on CLI commands or API endpoints. The core monitoring functionality (checks/notifications) remains intact.
- What are the security risks of using Laravel 5.4 in 2024?
- Laravel 5.4 is end-of-life and lacks security patches. Mitigate risks by isolating the app in a VM/container, pinning dependencies in `composer.json`, and scanning for vulnerabilities with tools like Snyk or PHPStan.
- Can I integrate this with PagerDuty or Opsgenie for enterprise alerts?
- Yes, extend the notification system to send alerts to PagerDuty or Opsgenie via webhooks. Create a custom notification channel by implementing Laravel’s `Notifiable` interface and configuring it in `config/server-monitor.php`.
- What’s the difference between this app and `laravel-server-monitor`?
- This app bundles `laravel-server-monitor` with a pre-built Laravel 5.4 admin dashboard and CLI tools. If you only need the monitoring logic, use `laravel-server-monitor` directly for better flexibility and modern Laravel compatibility.