Skip to content

Using the CLI

This guide installs a Sync Agent entirely from the command line using the Sync Agent Manager together with the Toolbelt (or direct API calls). It's well suited to scripted or headless installs and is available for Windows, macOS, and Linux.

Each step shows the Toolbelt command where applicable, with a raw shell/API equivalent as an alternative.

What you'll need

  • An API key with access to the target organization
  • The organization ID (ORG-ID)
  • The Sync Agent Manager download for your operating system

The Sync Agent Manager can be downloaded from the GitLab packages registry for the AU3 project, or directly via the commands below.

Windows

1. Download the Sync Agent Manager

Invoke-WebRequest -Headers @{'Authorization' = 'Bearer API-KEY'} -Uri 'https://compute-gateway.au3-compute.aunsight.com/manager/version/latest/os/windows' -OutFile 'sync-agent-manager_windows.zip'

2. Create a Sync Agent

toolbelt.exe sync-agent create --name AGENT-NAME

Or via the API:

Invoke-RestMethod -Method Post -ContentType application/json -Headers @{'Authorization'='Bearer API-KEY';'x-au-context'='ORG-ID'} -Uri 'https://api-au3.aunsight.com/sync/agent' -Body '{"name":"AGENT-NAME"}'

3. Generate a registration token

toolbelt.exe sync-agent issue-registration-token --id AGENT-ID

4. Extract the archive

Expand-Archive -Path .\sync-agent-manager_windows.zip -DestinationPath .\

5. Configure the Manager

.\sync-agent-manager.exe config update --AU3_API_URL https://api-au3.aunsight.com --AU3_RTM_URL wss://rtm-au3.aunsight.com

6. Install the agent

.\sync-agent-manager.exe sync-agent install --token REGISTRATION-TOKEN

macOS

1. Download the Sync Agent Manager

curl --output 'sync-agent-manager_osx.zip' -H 'Authorization: Bearer API-KEY' https://compute-gateway.au3-compute.aunsight.com/manager/version/latest/os/osx

2. Create a Sync Agent

toolbelt sync-agent create --name AGENT-NAME

3. Generate a registration token

toolbelt sync-agent issue-registration-token --id AGENT-ID

4. Extract the archive

unzip sync-agent-manager_osx.zip

5. Configure the Manager

./sync-agent-manager config update --AU3_API_URL https://api-au3.aunsight.com --AU3_RTM_URL wss://rtm-au3.aunsight.com

6. Install the agent

./sync-agent-manager sync-agent install --token REGISTRATION-TOKEN

7. Start the agent

./sync-agent/sync-agent

Linux

1. Download the Sync Agent Manager

curl --output 'sync-agent-manager_linux.zip' -H 'Authorization: Bearer API-KEY' https://compute-gateway.au3-compute.aunsight.com/manager/version/latest/os/linux

2. Create a Sync Agent

toolbelt sync-agent create --name AGENT-NAME

3. Generate a registration token

toolbelt sync-agent issue-registration-token --id AGENT-ID

4. Extract the archive

unzip sync-agent-manager_linux.zip

5. Make the Manager executable

chmod 775 sync-agent-manager

6. Configure the Manager

./sync-agent-manager config update --AU3_API_URL https://api-au3.aunsight.com --AU3_RTM_URL wss://rtm-au3.aunsight.com

7. Install the agent

./sync-agent-manager sync-agent install --token REGISTRATION-TOKEN

8. Start the agent

./sync-agent/sync-agent