Installation Guide #

Complete step-by-step installation instructions for the Server Monitor plugin.

Prerequisites #

Before installing ServerMonitor, ensure you have:

  • OctoberCMS 3.0+ running
  • Database access (MySQL/PostgreSQL)
  • Command line access to your server
  • Cron job configuration ability
  • Queue driver configured (database or Redis recommended)

Required Dependencies #

1. SaasBase Plugin (Required) #

This plugin requires the Albrightlabs.SaasBase plugin to be installed first. SaasBase provides:

  • Multi-tenant organization support
  • User authentication and management
  • Subscription billing integration
  • Branding and customization framework
cd plugins
git clone [saasbase-repository-url] albrightlabs/saasbase

Make sure SaasBase is properly configured before proceeding. See the SaasBase documentation for:

  • Stripe integration setup
  • Branding configuration
  • Running SaasBase migrations

Installation Steps #

1. Install ServerMonitor Plugin #

cd plugins
git clone [repository-url] albrightlabs/servermonitor

2. Run Database Migrations #

php artisan october:migrate

This creates the following tables:

  • servers - Server endpoint information
  • server_logs - Status change history
  • server_check_logs - Performance monitoring
  • dispatch_logs - Queue performance tracking
  • alert_logs - Communication history
  • servermonitor_notification_settings - Alert preferences

3. Configure Environment Variables #

Add these to your .env file:

# Queue Configuration
QUEUE_CONNECTION=database

# Server Monitor Settings
SERVER_MONITOR_API_KEY=your-secure-api-key-here
SERVER_MONITOR_ADMIN_EMAIL=admin@example.com
SERVERMONITOR_NOTIFICATION_DEBUG=false
SERVER_MONITOR_SMS_COST=0.0075

# Twilio Configuration (for SMS notifications)
TWILIO_SID=your-twilio-sid
TWILIO_TOKEN=your-twilio-token
TWILIO_NUMBER=+1234567890

# Branding (inherited from SaasBase)
SAAS_PRODUCT_ID=pulsey
SAAS_BRAND_NAME="Pulsey"
SAAS_BRAND_DESCRIPTION="Server monitoring made simple"

4. Create Configuration File (Optional) #

Create plugins/albrightlabs/servermonitor/config/config.php to override defaults:

<?php
return [
    'admin_email' => env('SERVER_MONITOR_ADMIN_EMAIL', 'admin@example.com'),
    'api_key' => env('SERVER_MONITOR_API_KEY'),
    'notification_debug' => env('SERVERMONITOR_NOTIFICATION_DEBUG', false),
    'sms_cost' => env('SERVER_MONITOR_SMS_COST', '0.0075'),

    'plans' => [
        'free' => [
            'server_limit' => 50,
            'user_limit' => 1,
            'logs_enabled' => true,
            'log_retention_days' => 7,
        ],
        'basic' => [
            'server_limit' => 200,
            'user_limit' => 0, // unlimited
            'logs_enabled' => true,
            'log_retention_days' => 30,
        ],
        // ... see configuration-guide.md for complete options
    ],
];

Post-Installation Setup #

1. Generate Secure API Key #

Create a strong API key for cron job authentication:

# Generate a secure random key
openssl rand -base64 32

Add this to your .env file as SERVER_MONITOR_API_KEY.

2. Configure Cache (Important) #

In config/cache.php, add:

'disableRequestCache' => true,

This prevents cache conflicts with queue workers.

3. Test Installation #

Check that the plugin is properly installed:

# Check if tables were created
php artisan tinker
>>> \Schema::hasTable('servers')
=> true

# Test the console command
php artisan servermonitor:checkserverstatus --help

Verification Checklist #

  • [ ] SaasBase plugin installed and configured
  • [ ] ServerMonitor plugin files present in /plugins/albrightlabs/servermonitor/
  • [ ] Database migrations completed successfully
  • [ ] Environment variables configured
  • [ ] API key generated and set
  • [ ] Cache configuration updated
  • [ ] Console commands respond properly

Next Steps #

After successful installation:

  1. Configure Settings - Set up plan limits and notification costs
  2. Set Up Queues - Configure Supervisor for background processing
  3. Add Cron Jobs - Schedule automated server checks

Troubleshooting Installation #

Common Issues #

Migration Failures

# Check database connection
php artisan tinker
>>> \DB::connection()->getPdo()

# Run migrations with verbose output
php artisan october:migrate --verbose

Plugin Not Found

# Verify directory structure
ls -la plugins/albrightlabs/
# Should show both 'saasbase' and 'servermonitor'

# Check October plugin cache
php artisan cache:clear
php artisan october:env

Permission Errors

# Fix file permissions
sudo chown -R www-data:www-data plugins/albrightlabs/servermonitor
sudo chmod -R 755 plugins/albrightlabs/servermonitor

Getting Help #

If you encounter issues:

  1. Check the Troubleshooting Guide
  2. Enable debug mode: APP_DEBUG=true in .env
  3. Check Laravel logs in storage/logs/
  4. Contact support: support@albrightlabs.com

Previous: README | Next: Configuration Guide