If OceanBase Diagnostic Tool (obdiag) is independently deployed, you can run this command to collect information about nodes in the specified OceanBase cluster, such as the dmesg, CPU, and memory information of the nodes.
If your OceanBase cluster is deployed by using OceanBase Deployer (obd), you can run obdiag commands on obd to collect diagnostic information of the cluster. For more information about the commands, see obdiag commands.
Syntax
obdiag gather sysstat [options]
The following table describes the options.
| Option | Required? | Data type | Default value | Description |
|---|---|---|---|---|
| --store_dir | No | string | The current path where the command is executed | The local path where the results are stored. |
| -c | No | string | ~/.obdiag/config.yml |
The path of the configuration file. |
| --inner_config | No | string | Empty | The configurations of obdiag. |
| --config | No | string | Empty | The configurations of the cluster diagnosed by obdiag, in the format of --config key1=value1 --config key2=value2.
NoteFor information about the parameters supported by this option, see Configure obdiag. |
Examples
Method 1: Use the command out-of-the-box without a configuration file
obdiag gather sysstat \
--config obcluster.servers.nodes[0].ip=xx.xx.xx.1 \
--config obcluster.servers.nodes[1].ip=xx.xx.xx.xx.2 \
--config obcluster.servers.global.ssh_username=test \
--config obcluster.servers.global.ssh_password=****** \
The output is as follows:
Summary:
+-------------------+-----------+---------+--------+--------------------------------------------------------------------------------+
| Node | Status | Size | Time | PackPath |
+===================+===========+=========+========+================================================================================+
| xxx.xxx.xxx.xxx | Completed | 45.209K | 5 s | obdiag_gather_pack_20220729164233/sysstat_xxx.xxx.xxx.xxx_20220729164233.zip |
+-------------------+-----------+---------+--------+--------------------------------------------------------------------------------+
| xxx.xxx.xxx.xxx | Completed | 42.170K | 5 s | obdiag_gather_pack_20220729164233/sysstat_xxx.xxx.xxx.xxx_20220729164233.zip |
+-------------------+-----------+---------+--------+--------------------------------------------------------------------------------+
Collect information of nodes accessible to obdiag without a password.
obdiag gather sysstat \ --config obcluster.servers.nodes[0].ip=xx.xx.xx.1 \ --config obcluster.servers.nodes[1].ip=xx.xx.xx.xx.2Collect information of nodes with different SSH logon passwords.
obdiag gather sysstat \ --config obcluster.servers.nodes[0].ip=xx.xx.xx.1 \ --config obcluster.servers.nodes[0].ssh_username=test1 \ --config obcluster.servers.nodes[0].ssh_password=****** \ --config obcluster.servers.nodes[1].ip=xx.xx.xx.xx.2 --config obcluster.servers.nodes[1].ssh_username=test2 \ --config obcluster.servers.nodes[1].ssh_password=******Collect information of all nodes in a cluster with the connection information of the
systenant specified. In this case, obdiag automatically obtains the IP addresses of all nodes in the cluster.obdiag gather sysstat \ --config db_host=xx.xx.xx.xx \ --config db_port=xxxx \ --config tenant_sys.user=root@sys \ --config tenant_sys.password=***
Method 2: Use the command with a configuration file
Before you run the command, make sure that you have configured the logon information of the target nodes in the config.yml configuration file of obdiag. For more information, see Configure obdiag.
obdiag gather sysstat
Results
The command generates a folder in the specified directory. A sample folder name is
obdiag_gather_pack_20240808105846.In the folder, information collected from different nodes is compressed into a .zip file. You can decompress the .zip file to obtain the following information:
#tree . ├── dmesg.human.current # The dmesg information of the nodes. ├── one_day_cpu_data.txt # The CPU utilization of the nodes within the last day, which is collected from tsar on the nodes. ├── one_day_mem_data.txt # The memory usage of the nodes within the last day, which is collected from tsar on the nodes. ├── tsar_io_data.txt # The I/O information of the nodes, which is collected from tsar on the nodes. ├── tsar_swap_data.txt # The swap information of the nodes, which is collected from tsar on the nodes. ├── tsar_tcp_udp_data.txt # The UDP information of the nodes, which is collected from tsar on the nodes. └── tsar_traffic_data.txt # The traffic information of the nodes, which is collected from tsar on the nodes.