Skip to content

Offline Discovery with chctl

Overview

chctl provides a simple mechanism to support CHAI™ offline discovery functionality from your local workstation.

CHAI™ Offline Discovery Architecture

Offline discovery can be performed within an air-gapped environment that may be completely isolated and disconnected from the CHAI™ portal. Cloud practitioners can use the CHAI™ command-line utility (chctl) to trigger offline discovery for Linux and Windows systems within the air-gapped environment.

The offline discovery information is captured from the Linux and Windows systems, and the captured metadata is transferred to the CHAI™ portal when internet connectivity becomes available.


Prerequisites

Windows Discovery Requirements

For Windows discovery, the latest version (7.3+) of Microsoft PowerShell with WinRM must be installed:

WinRM PowerShell Module Installation

To install the WinRM PowerShell module, run the following command:

sudo pwsh -Command 'Install-Module -Name PSWSMan -Force'

To check the installed WinRM module version (recommended version is 2.3+), run:

pwsh -Command 'find-module -Name PSWSMan'

Expected output:

Version   Name      Repository   Description
-------   ----      ----------   -----------
2.3.1     PSWSMan   PSGallery    Module to install and manage the forked WSMan client libraries for Linux and macOS.

chctl Tool Download

Download the latest version of chctl from the links below:

  • macOS: https://chctl-preview.s3.us-east-2.amazonaws.com/chctl_mac
  • Linux: https://chctl-preview.s3.us-east-2.amazonaws.com/chctl_linux
  • Windows: https://chctl-preview.s3.us-east-2.amazonaws.com/chctl.exe

Make the chctl tool executable and copy it to your system path.

Login to CHAI™ Portal

Before starting offline discovery, log in to the CHAI™ portal:

chctl utils login --username user@email --password password --server https://app.cloudhedge.io

Offline Discovery Process

  1. Download the chctl tool to your local laptop or workstation
  2. Ensure all prerequisites are in place
  3. Gather connection information for the local application servers (hostname/IP, credentials)
  4. Trigger offline discovery according to the scenarios described in the Scenarios section below

Data Upload Workflow

  • With internet connection: If there is internet connectivity between your local laptop/workstation and the CHAI™ portal, the offline discovery information is uploaded directly to the CHAI™ portal
  • Without internet connection: If connectivity is not available, the discovered data is stored on your local system
  • Deferred upload: Once internet connectivity is established, the discovered data can be published to the CHAI™ portal

Scenarios

Scenario 1: Discover Linux System with Password-Based Authentication

Example parameters: - System hostname: node1 - System username: ch - System password: base64encpassword (example encoded password)

chctl discover local --node node1 --osType linux --userName remoteuser --secret R0hUIzAK --waveName offline-wave

Note: Replace R0hUIzAK with your actual base64-encoded password.


Scenario 2: Discover Linux System with Key-Based Authentication

Example parameters: - System hostname: node1 - System username: ch - System key: base64enckey (example encoded key)

chctl discover local --node node1 --osType linux --userName remoteuser --secret GDRE454WWx --waveName offline-wave

Note: Replace GDRE454WWx with your actual base64-encoded key.


Scenario 3: Discover Windows System with Password-Based Authentication

Example parameters: - System hostname: winnode1 - System username: ch - System password: base64encpassword (example encoded password)

chctl discover local --node winnode1 --osType windows --userName remoteuser --secret R0hUIzAK --waveName offline-wave

Note: Replace R0hUIzAK with your actual base64-encoded password.


Scenario 4: Upload Locally Stored Discovery Data to CHAI™ Portal

Use this command to upload previously captured offline discovery data to the CHAI™ portal when internet connectivity is available:

chctl discover upload --osType windows --waveName offline-wave

Note: Replace windows with the appropriate OS type and offline-wave with your wave name.