PHP code example of netserva / fleet

1. Go to this page and download the library: Download netserva/fleet library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

netserva / fleet example snippets


'vsites' => [
    'directory_mappings' => [
        'mgo' => ['provider' => 'local', 'technology' => 'incus', 'location' => 'workstation'],
        'nsorg' => ['provider' => 'binarylane', 'technology' => 'vps', 'location' => 'sydney'],
    ],
],

'discovery' => [
    'discovery_commands' => [
        'compute' => [
            'hostname -f',
            'uname -a',
            'cat /proc/cpuinfo | grep "processor" | wc -l',
            // ... more commands
        ],
        'network' => [
            'hostname',
            'uptime',
            'ip addr show',
        ],
    ],
],
bash
php artisan migrate
bash
php artisan vendor:publish --tag=fleet-config
bash
# Discover all nodes that need scanning
php artisan fleet:discover

# Discover specific vnode
php artisan fleet:discover --vnode=mgo

# Force discovery even if not scheduled
php artisan fleet:discover --force

# Test SSH connections only
php artisan fleet:discover --test-ssh
bash
# Run all fleet tests
php artisan test packages/netserva-fleet/tests

# Run specific test groups
php artisan test --group=fleet
php artisan test --group=discovery
php artisan test --group=import