Installing the cpctl utility to access support actions

IBM Security QRadar® Suite Software provides support actions to help you with postinstallation, administration, and troubleshooting tasks. You access these support actions through the cpctl command-line interface (CLI) utility.

Before you begin

To complete this task, you must be a Red Hat® OpenShift® cluster administrator.

Review the Planning for installation section to ensure that you meet the hardware, system, storage, and other requirements.

Before you install QRadar Suite Software, review and take the following prerequisite steps for a successful installation.

Install Windows Subsystem for Linux (WSL)

Windows only If you are using a Windows computer, you must install Windows Subsystem for Linux® (WSL).

For more information about installing WSL, see Install WSL.

Install Red Hat OpenShift CLI 4.12 or later

The Red Hat OpenShift CLI client helps you develop, build, deploy, and run your applications on any Red Hat OpenShift or Kubernetes cluster. It also includes the administrative commands for managing a cluster under the adm subcommand.

Procedure

  1. Download Red Hat OpenShift CLI 4.12 or later from https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable-4.12/. The file to download is called openshift-client-<platform>-<version>.tar.gz.
  2. Extract the binary file that you downloaded by typing the following command, where <oc_cli_archive_file> is the name of the archive file that you downloaded.
    tar -xf <oc_cli_archive_file>
  3. Modify the permissions of the binary file by typing the following command, where <oc_cli_binary> is the name of the Red Hat OpenShift binary that you extracted from the archive.
  4. Move the binary file to the /usr/local/bin directory by typing the following command.
    mv <oc_cli_binary> /usr/local/bin/oc
    Tip: If this command returns a No such file or directory or Not a directory error message, create the /usr/local/bin directory by typing the following command.
    sudo mkdir /usr/local/bin
  5. Ensure that the Red Hat OpenShift CLI client is working by typing the following command.
    oc version
    Tip: MacOS users might see a message that this tool cannot be opened because it is from an unidentified developer. Close this message and go to System Preferences > Security & Privacy. On the General tab, click Open Anyway or Allow Anyway. Repeat the oc version command.

Installing the cpctl utility to access support actions

Complete the procedure to ensure that you have the most recent version of the cpctl utility.

Procedure

  1. Log in to your Red Hat OpenShift Container Platform cluster by using either of the following commands, where <openshift_url> is the URL for your Red Hat OpenShift Container Platform environment.
    • Using a username and password.
      oc login <openshift_url> -u <username> -p <password>
    • Using a token.
      oc login --token=<token> --server=<openshift_url>
  2. Retrieve the name of the serviceability pod by typing the following command.
    POD=$(oc get pod --no-headers -lrun=cp-serviceability | cut -d' ' -f1)
  3. Copy the cpctl utility to your local computer.
    • If your local computer operating system is Linux, type the following command.
      rsync --rsh='oc rsh' -av -c --inplace --partial --append --progress $POD:/opt/bin/linux/cpctl ./cpctl && chmod +x ./cpctl
    • If your local computer is a Mac with an Intel processor, type the following command.
      rsync --rsh='oc rsh' -av -c --inplace --partial --append --progress $POD:/opt/bin/darwin/cpctl ./cpctl && chmod +x ./cpctl
    • If your local computer is a Mac with an ARM processor, type the following command.
      rsync --rsh='oc rsh' -av -c --inplace --partial --append --progress $POD:/opt/bin/darwin/arm64/cpctl ./cpctl && chmod +x ./cpctl
  4. Optional: If you have the right permissions, you can add the utility to your global PATH by typing the command.
    mv cpctl /usr/local/bin
  5. To ensure that the list of available actions is up to date, run the following command to begin each session.
    cpctl load
    The cpctl load command retrieves all of the available actions that can be run on QRadar Suite Software. The actions are cached to the local environment of the current user.
    You can run the cpctl -h command for a complete list of the available commands and actions. The cpctl actions are grouped into these categories:
    • diagnostics
    • remediation
    • tools

    To run an action, enter the command in the format cpctl <group> <action>. You can run cpctl <group> -h for a complete list of the actions that are currently available in each group. Each action has its own help menu that can be accessed by running cpctl <group> <action> -h.

Upgrading the cpctl utility

Upgrade the cpctl utility to the latest version.

Procedure

  1. To ensure that the list of available cpctl actions is up to date, enter the following command.
    cpctl load
    The cpctl load command retrieves all of the available actions that can be run on QRadar Suite Software. The actions are cached to your local environment.
  2. Compare the version of cpctl on your local machine with the version in your Red Hat OpenShift cluster by typing the following command.
    cpctl sync_cpctl_version
  3. If the output of the previous command indicates that cpctl needs to be upgraded, type one of the following commands.
    • If cpctl is stored in your system PATH, type the following command.
      cpctl sync_cpctl_version --action upgrade
    • If cpctl is not stored in your system PATH, type the following command where <path_to> is the path to the cpctl binary.
      ./cpctl sync_cpctl_version --path <path_to>/cpctl --action upgrade
  4. Verify that cpctl is upgraded by typing the following command and verifying that the version in the output is the same as the latest version in the output of the command from step 2.
    cpctl -v
  5. To ensure that the list of available cpctl actions is up to date, enter the following command.
    cpctl load
    The cpctl load command retrieves all of the available actions that can be run on QRadar Suite Software. The actions are cached to your local environment.