This article applies to the scenario of independent deployment of obdiag. Use the obdiag gather variable command to collect variable information with one click and store it in a csv file, which can be used for variable comparison and archiving.
If it is a cluster deployed by obd, you can directly collect information on the selected cluster through the obd side diagnostic command group.
Instructions for use
obdiag gather variable [options]
The options are explained below:
Option name |
Is it required |
Data type |
Default value |
Description |
|---|---|---|---|---|
| --store_dir | No | string | Defaults to the current path where the command is executed | The local path where the results are stored. |
| -c | No | string | ~/.obdiag/config.yml |
Configuration file path. |
| --inner_config | No | string | Default is empty | obdiag's own configuration. |
| --config | No | string | Default is empty | Configuration of the cluster to be diagnosed by obdiag, fixed style: --config key1=value1 --config key2=value2.
ExplanationThe parameters that support configuration through this option can be found in obdiag configuration. |
| --config_password | No | string | Default is empty | obdiag When using an encrypted configuration file, you need to pass in the corresponding password through this option.
ExplanationFor details, see Configuration file encryption. |
Usage example
Method 1: Use without configuration file (out of the box)
obdiag gather variable \
--config db_host=xx.xx.xx.xx \
--config db_port=xxxx \
--config tenant_sys.user=root@sys \
--config tenant_sys.password=***
The output is as follows:
gather_variables start ...
Gather variables finished. For more details, please run cmd 'cat /home/admin/gather_variables/gather_variables/obcluster_variables_20240808144053.csv'
Trace ID: 28736940-5551-11ef-9ca9-a6e6206c49dc
If you want to view detailed obdiag logs, please run: obdiag display-trace 28736940-5551-11ef-9ca9-a6e6206c49dc
You can specify the collection result storage directory through the --store_dir parameter, such as specifying to store it in the /tmp directory:
obdiag gather variable --store_dir /tmp/ \
--config db_host=xx.xx.xx.xx \
--config db_port=xxxx \
--config tenant_sys.user=root@sys \
--config tenant_sys.password=***
Method 2: Use with configuration file
You need to ensure that the login information of the node to be collected has been configured in the obdiag configuration file config.yml. For related detailed configuration introduction, see obdiag configuration.
obdiag gather variable
The output is as follows:
gather_variables start ...
Gather variables finished. For more details, please run cmd 'cat /home/admin/gather_variables/gather_variables/obcluster_variables_20240808144053.csv'
Trace ID: 28736940-5551-11ef-9ca9-a6e6206c49dc
If you want to view detailed obdiag logs, please run: obdiag display-trace 28736940-5551-11ef-9ca9-a6e6206c49dc
You can specify the collection result storage directory through the --store_dir parameter, such as specifying to store it in the /tmp directory:
obdiag gather variable --store_dir /tmp/
Specify the cluster configuration to be collected via -c:
obdiag gather variable --store_dir -c test.yml
Report Interpretation
After the command is executed, a csv file will be generated in the specified directory. The file format is: ./gather_variables/obcluster_variables_20240808144053.csv, which can be used for variable comparison archiving.
