Using cbsupport CLI to collect the requested data

Issue

What is the best practice to collect data for CloudBees Support?

Environment

Resolution

The tool

cbsupport is a command line tool that allows to collect data on a Jenkins installation.

Tool installation

Where to install the tool

Depending on your installation type, the cbsupport tool needs to be installed in different location.

  • CloudBees Core on Modern Platforms

The tool needs to be installed on a machine with an access to the cluster running CloudBees Core.

  • CloudBees Jenkins Enterprise version 1.x

The tool needs to be installed on the bastion host (ie the machine where you run your cje commands).

  • Other installations

The tool needs to be installed on the machine running either the Operation Center (in case you have one), or the master (in case you are running a single isolated master).

NOTE: There is currently no multi cluster support.

How to install it

From a directory in your PATH, simply run:

  • Mac OS X: curl -L -o cbsupport https://s3.amazonaws.com/cbsupport-binaries/stable/cbsupport-darwin-amd64 && chmod +x cbsupport
  • Linux: curl -L -o cbsupport https://s3.amazonaws.com/cbsupport-binaries/stable/cbsupport-linux-amd64 && chmod +x cbsupport
  • Windows: curl -L -o cbsupport https://s3.amazonaws.com/cbsupport-binaries/stable/cbsupport.exe

Feel free to use wget or simply your browser to retrieve the binary.

Setup the environment

All OSs

  • CloudBees Core on Modern Platforms

You need kubectl installed and configured to point to the cluster running the product.
As a simple test, running kubectl get pods --all-namespaces |grep cjoc should at least return one result.

OsX specific

You’ll need docker-credential-osxkeychain.
Note that if you have docker installed, you most likely have the docker credential oskeychain installed.

This third party is used to interact with the osx keychain to securely store the credentials you provide to the tool.

Linux specific

On Linux, the tool uses pass to securely store the credentials you provide to the tool.

Setting up pass on Debian/Ubuntu

Here are simple instructions for Debian/Ubuntu:

    sudo apt-get install pass
    pass init <gpg_key_id>

    #if no gpg key:
    gpg2 --gen-key

You might encounter an issue running the last command.
Most likely this is because your installation doesn’t generate enough entropy to generate the gpg key, in which case you want to install rngd-utils:

    #if not enough entropy to generate the key, install rngd-utils
    sudo apt-get install rng-tools

Finally, you want to setup this environment variable in your shell startup script (.bashrc, .zshrc…):

export GPG_TTY=$(tty)
Setting up on RedHat/Fedora/CentOS
sudo yum install pass

In case this is not available from your configured repositories, then you can install it from the tarball at https://www.passwordstore.org/ by running sudo make install

NOTE: For more details, please refer to Pass: The Standard Unix Password Manager

Configure the tool using the wizard

Simply run cbsupport setup and follow the instructions.

A few notes:

  1. The Jenkins user should have admin privileges to be able to generate the bundle.
  2. Do not use the password of the user, but generate a token as indicated in How to (re)generate my Jenkins user token – CloudBees Support.

Verify the installation

You can run the check command, that will make some basic smoke tests with the configuration you provided in the setup:

cbsupport check

Once the check is made, cbsupport is ready to be used.

CLI usage

CloudBees Support or the Knowledge Base article you are following should give you the command to run.
However here is an overview of some useful commands.

Check

Runs some smoke tests to make sure the cli is correctly installed and configured:

cbsupport check

Version

Dumps information about the running cbsupport binary and also will notify in case a new version is available:

cbsupport version

Update

Updates the cbsupport binary to the latest available version:

cbsupport update

Generating the default information

This command will generate the default information that support needs.
In case of doubt, just use this command:

cbsupport required-data default

The command is interactive and will ask for the tenant(s) on which the data gathering should happen.

Generating specific information

In case of a specific issue, support will ask you to gather more specific data.
For instance, in case of a performance issue it will ask for cbsupport required-data performance

Advanced commands

More advanced commands are available (to run a custom script on a tenant for instance).
In case one of this command is needed, CloudBees Support will ask you to run it.

Known limitations and unsupported features

  • Proxies are not supported
  • Self signed certificates are not supported
  • OpenShift is not supported
  • When creating the working directory, cbsupport cannot create nested directories (ie the directory you provide should be located in an existing directory).
  • ~ is not recognized as home by cbsupport therefore you shouldn’t use it when providing path to the CLI.
  • In case the targeted tenant is slow to generate a support bundle, the CLI will keep the connection up without any visual feedback making think it’s stuck.
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.