# Platform Diagnostics Tools

These tools collect and display key information about the Datasentinel platform, making it easier to troubleshoot problems efficiently and provide faster resolutions.

## Diagnostics

```bash
/datasentinel/soft/datasentinel_backend/scripts/datasentinel_diagnostics.sh
```

This script provides:

1. **Detailed OS Information** – Including memory usage by Datasentinel components (+ InfluxDB) and data directory sizes.
2. **InfluxDB Diagnostics** – Connects to the InfluxDB database to retrieve retention policies, system metrics, shard usage, and configuration settings.
3. **Monitored Instance Details** – Displays key information about all monitored PostgreSQL instances.

{% hint style="warning" %}
The script outputs the information directly in the terminal and also writes the results to a file located at:\
\&#xNAN;**`/tmp/datasentinel_diagnostics_<HOST_NAME>.txt`**
{% endhint %}

## Compress log files

```bash
/datasentinel/soft/datasentinel_backend/scripts/compress_log_files.sh
```

This script compress backend log files from `/datasentinel/log` and creates `/tmp/datasentinel_trace_files.tar.gz` for support use.

## SQL Collection Limit Analysis

```bash
/datasentinel/soft/datasentinel_backend/scripts/dump_top_instance_query_texts.sh 10
```

This script identifies the top N PostgreSQL instances that have reached their **daily SQL collection limit** and extracts the **query texts** collected for the current day.

It accepts an optional parameter to specify the **top N instances** (default 5) to include in the output.

It helps analyze which queries were captured before the limit was hit, providing useful insights for troubleshooting or fine-tuning monitoring settings.

{% hint style="warning" %}
The results are saved to files **`/tmp/<INSTANCE_NAME>.txt`**
{% endhint %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.datasentinel.io/manual/implementation/troubleshooting/platform-diagnostics-tools.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
