> For the complete documentation index, see [llms.txt](https://docs.weka.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.weka.io/support/diagnostics-management/diagnostics-data-management.md).

# Diagnostics data management

Manage diagnostics data for clusters, servers, and containers with CLI commands.

The diagnostics CLI commands enable managing diagnostics data associated with clusters, servers, and containers. The Customer Success Team then analyzes this diagnostics data to assist in troubleshooting. Two options are available for managing diagnostics:

* **Cluster-wide diagnostics commands:** Use the command `weka diags` for cluster-wide diagnostics management from any server within the cluster.
* **Local server diagnostics command:** Use the command `weka local diags` for diagnostics management of a connected local server.

## Cluster-wide diagnostics commands

Use the cluster-wide diagnostics commands to oversee diagnostics data on any cluster server. This includes functionalities to upload diagnostics data to WEKA Home, collect diagnostics data, clean up diagnostics files, and list available diagnostics files.

### Upload diagnostics data to WEKA Home

**Command:** `weka diags upload`

Use the following command to collect diagnostics information, save it, and upload it to WEKA Home (the WEKA support cloud):

```bash
weka diags upload [--core-limit core-limit] [--dump-id dump-id] [--container-id container-id]... [--clients] [--backends]
```

The command response provides an access identifier, `Diags collection ID`. Send this access identifier to the Customer Success Team to retrieve the diagnostics data from WEKA Home.

When running the command for all servers in the cluster, a local diagnostics file (dump) is created in each server in the location `/opt/weka/diags/local`. The local diagnostics file of each server is consolidated in a single diagnostics file in the server where you run the command in the `/opt/weka/diags` directory.

{% hint style="info" %}
HTTPS access is required to upload the diagnostics to AWS S3 endpoints.

The upload process is asynchronous. Therefore, connectivity failure events are reflected in the events log even if the command exits successfully.
{% endhint %}

**Parameters**

<table><thead><tr><th width="175.3984375">Name</th><th width="360.3125">Description</th><th>Default</th></tr></thead><tbody><tr><td><code>core-limit</code></td><td>Limit the diagnostics collection process to use the specified core number.</td><td>1</td></tr><tr><td><code>dump-id</code></td><td>Uploads a pre-existing diagnostics file (dump) generated by the <code>weka diags collect</code> command with the specified dump ID. Using this option, the command exclusively uploads data and does not conduct data collection. Do not use this option for data previously generated by a <code>weka diags upload</code> command. The command evaluates the list of containers for dump upload, which may differ from those collected in the specified dump directory. Any container data not found in the collected dump is disregarded.</td><td>If no ID is provided, a new diagnostics file is generated.</td></tr><tr><td><code>container-id</code></td><td>A list of container ID numbers separated by commas for collecting and uploading diagnostics data. If specified, the <code>--backends</code> and <code>--clients</code> options are ignored.</td><td></td></tr><tr><td><code>clients</code></td><td>Collect and upload diagnostics data only from client containers.</td><td>No data is collected for clients.</td></tr><tr><td><code>backends</code></td><td>Collect and upload diagnostics data only from backend containers (same as if you are not specifying this option). To collect diagnostics for all client and backend containers, add both options <code>--backends</code> and <code>--clients</code> to the command.</td><td>Backends only.</td></tr></tbody></table>

**Example: collect and upload diagnostics from all backend containers**

```bash
$ weka diags upload
Uploading diags from 5 hosts to the cloud
Cluster GUID: c0aca0f2-0d20-465e-9817-e747be811016
Diags collection ID: 1Ox5OYogdTP54Nah7o1cb
Cloud URL: https://api.home.weka.io
Collecting diags
[........................................] 5 / 5
Copying files for uploading
[........................................] 5 / 5
Uploading to cloud (this could take a while)
[........................................] 125 / 125
+------------------------+
| Diags upload completed |
+------------------------+
```

### Collect diagnostics data

**Command:** `weka diags collect`

Use the following command to create diagnostics information and save it without uploading it to WEKA Home. This command is useful when there is no connection to WEKA Home, and you want to share the diagnostics file using other options.

```bash
weka diags collect [--id id] [--output-dir output-dir] [--core-limit core-limit] [--container-id container-id] [--clients] [--backends] [--tar]
```

If the command runs with the `local` keyword, information is collected only from the server on which the command is executed. Otherwise, information is collected from the whole cluster.

**Parameters**

<table><thead><tr><th width="161.625">Name</th><th width="344.84765625">Description</th><th>Default</th></tr></thead><tbody><tr><td><code>id</code></td><td>An optional identifier for this diagnostics file. If not specified, a random ID is generated.</td><td>Auto-generated</td></tr><tr><td><code>output-dir</code></td><td>The directory for saving the diagnostics file.</td><td><code>/opt/weka/diags</code></td></tr><tr><td><code>core-limit</code></td><td>Limit the diagnostics collection process to use the specified core number.</td><td>1</td></tr><tr><td><code>container-id</code></td><td>A list of container ID numbers separated by commas for collecting diagnostics data. If specified, the <code>--backends</code> and <code>--clients</code> options are ignored.</td><td></td></tr><tr><td><code>clients</code></td><td>Collect diagnostics data only from client containers.</td><td>No data is collected for clients.</td></tr><tr><td><code>backends</code></td><td>Collect diagnostics data only from backend containers (same as if you are not specifying this option). To collect diagnostics for all client and backend containers, add both options <code>--backends</code> and <code>--clients</code> to the command.</td><td>Backends only.</td></tr><tr><td><code>tar</code></td><td>Package the collected diagnostics in a TAR file.</td><td>No TAR file is created.</td></tr></tbody></table>

**Example: collect diagnostics from all backends**

```bash
$ weka diags collect
Downloading cluster diagnostics from 5 hosts to this host
Diags will be saved to:
/opt/weka/diags/ody2uRl8xOfDESd6vkbYH4
Collecting diags
[........................................] 5 / 5
Downloading artifacts
[........................................] 46.43 MiB / 46.43 MiB
```

The output continues with a table listing each collected diagnostic per category (host, weka\_host, cluster, and report) and its collection result per server, followed by a summary of any errors found.

The `weka diags collect` command consolidates diagnostics from various containers into a single dump directory. Conversely, `weka diags upload` saves diagnostics data on each container, distributing files across the cluster before uploading to WEKA Home.

### Clean up the diagnostics files

Collecting diagnostics data generates individual files, consuming disk space. As a result, the system may accumulate numerous diagnostics files, especially after they have been uploaded to WEKA Home. To optimize disk space usage, perform a cleanup either on a specific diagnostics file or an entire directory containing multiple diagnostics files.

Cleanup procedure:

1. List diagnostics files. List the diagnostics files in the system, including their corresponding IDs. This step provides an overview of the available diagnostics files.
2. Delete specific diagnostics files. Delete specific diagnostics files based on their IDs. This targeted cleanup helps efficiently manage disk space and ensures the removal of unnecessary diagnostics data.

{% hint style="warning" %}
The diagnostics files are essential for troubleshooting purposes. Delete these files only if you are certain they have been successfully uploaded to WEKA Home and are no longer needed. For further clarification, contact the Customer Success Team.
{% endhint %}

### List diagnostics files

**Command:** `weka diags list`

Use the following command to list the collected diagnostics files:

```bash
weka diags list [--verbose] [<id>]...
```

**Parameters**

<table><thead><tr><th width="151.8125">Name</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>The diagnostics file's ID or the path to the diagnostics file. If not specified, a list of all collected diagnostics files is displayed.</td></tr><tr><td><code>verbose</code></td><td>Displays the results of all the diagnostics files, including the successful ones.</td></tr></tbody></table>

### Delete specific diagnostics files

**Command:** `weka diags rm`

Use the following command to stop a running diagnostics instance, cancel its upload, and delete it from the disk:

```bash
weka diags rm [--all] [<id>]...
```

**Parameters**

<table><thead><tr><th width="124.015625">Name</th><th>Description</th></tr></thead><tbody><tr><td><code>all</code></td><td>A flag to delete all the diagnostics files.</td></tr><tr><td><code>id</code>*</td><td>The diagnostics file's ID or the path to the diagnostics files. This string is required unless the <code>all</code> option is specified.</td></tr></tbody></table>

## Local server diagnostics command

Collecting diagnostics data from a connected local server is valuable in various scenarios, such as:

* Lack of a functional management process in the originating backend container or the specified backend containers.
* Absence of connectivity between the management process and the cluster leader.
* The cluster lacking a leader.
* The local container is offline.
* The server cannot establish communication with the leader or encounters a failure when attempting the `weka diags` command.

**Command:** `weka local diags`

Use the following command to collect diagnostics from a connected local server:

```bash
weka local diags [--id id] [--output-dir output-dir] [--core-dump-limit core-dump-limit] [--collect-cluster-info] [--tar]
```

**Parameters**

<table><thead><tr><th width="217.234375">Name</th><th width="324.84765625">Description</th><th>Default</th></tr></thead><tbody><tr><td><code>id</code></td><td>A unique identifier for this diagnostics file.</td><td>Auto-generated</td></tr><tr><td><code>output-dir</code></td><td>The directory for saving the diagnostics file.</td><td><code>/opt/weka/diags</code></td></tr><tr><td><code>core-dump-limit</code></td><td>Limit the diagnostics collection process to use the specified core number.</td><td>1</td></tr><tr><td><code>collect-cluster-info</code></td><td>Collect diagnostics data related to the cluster. To prevent excessive load on the cluster, use this flag for one server at a time.</td><td></td></tr><tr><td><code>tar</code></td><td>Package the collected diagnostics data in a TAR file.</td><td>No TAR file is created.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.weka.io/support/diagnostics-management/diagnostics-data-management.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
