Ledger Information Collection Functions
Command Function
Collects application ledger information in system migration using the terminal tool.
Syntax
- Linux:
1devkit sys-mig [-h | --help] [-c stmt | --command stmt] [-cf configure_file_path | --config configure_file_path] [-d scan_path | --directory scan_path] [-src source_file_path | --source source_file_path] [-t stmt_template_path | --template stmt_template_path] [-db db_config | --db-config db_config] [-mn group_name | --multi-node group_name] [-ec | --encipher] [-s source_path | --show source_path] [-o report_dir | --output report_dir] [-l {0,1,2,3} | --log-level {0,1,2,3}] [-v | --version]
- Windows:
1sys-mig.exe [-h | --help] [-c stmt | --command stmt] [-cf configure_file_path | --config configure_file_path] [-d scan_path | --directory scan_path] [-src source_file_path | --source source_file_path] [-o report_dir | --output report_dir] [-t stmt_template_path | --template stmt_template_path] [-l {0,1,2,3} | --log-level {0,1,2,3}] [-s source_path | --show source_path] [-v | --version]
Parameter Description
All parameters are optional.
Parameter |
Option |
Description |
|---|---|---|
-h/--help |
- |
Obtains help information. |
-c/--command |
stmt/sbom/mvn_analyse |
Information collection mode.
|
-cf/--config |
- |
Configuration file path. Parameters can be entered using a configuration file. The default configuration file template is ./sys-mig/resources/sysmig_default.conf. Configuration File Usage Example provides examples. |
-d/--directory |
- |
Directory of files to be scanned, which is used to collect ledger information. You can enter multiple directories and separate them with spaces. Example: /home/test1 /home/test2 |
-src/--source |
- |
File directory to be scanned. It is used to calculate the number of source code lines. You can enter multiple directories and separate them with spaces. Supported source code languages: Java, C, C++, Python, Shell, JS, HTML, and CSS. If a directory name contains spaces, use single quotation marks (') to mark the parameter. |
-t/--template |
- |
Template file path of the ledger scan result. By default, the scan result is generated based on the built-in template of the program. NOTE:
The default template file path is ./sys-mig/template/stmt_template_default.csv. In the template file, the first row is the information to be searched for and the second row is the internal variable of the searched information. For the internal variables, you can delete or move them, but cannot modify them. |
-o/--output |
- |
Report output directory, which defaults to the report directory where the sys-mig binary file is located. Example: /home/report |
-l/--log-level |
0/1/2/3 |
Log level, which defaults to 1. This parameter is optional.
|
-db/--db-config |
- |
Collects database information about one or more nodes in Linux using either of the following methods:
|
-mn/--multi-node |
all/ungrouped/groupName |
Group name of the remotely scanned server. This parameter is available only in Linux. The configuration file is ./sys-mig/nodes/nodes.conf. For details about the format, see Configuration File Use (-mn/--multi-node). NOTE:
All groups are placed in the all group, and ungrouped servers are placed in the ungrouped group. |
-ec/--encipher |
- |
Enter the text to be encrypted. |
-s/--show |
- |
Displays the middleware and database source paths. If you do not set this parameter, the scan report will not include the middleware and database source paths. |
-v/--version |
- |
Displays the program version information. You do not need to set this parameter. |
Example
- Collecting the local node information:As an example, collect information in the /home/software directory, calculate the number of code lines in the /opt/code directory, and export the scan report to the /home/report directory. Replace the example file path with the actual one.
1devkit sys-mig -c stmt -d /home/software -src /opt/code -o /home/report
Command output:
[2025-11-18 19:29:31,635] [INFO] Start to execute the command: ./devkit sys-mig -c stmt -cf /usr/local/devkit/sys-mig/resources/sysmig_default.conf -d /home/software -o /home/report -t /usr/local/devkit/sys-mig/template/stmt_template_default.csv -l 1 -src /opt/code [2025-11-18 19:29:31,635] [INFO] Creating file indexing... [2025-11-18 19:29:31,667] [INFO] Parsing... [2025-11-18 19:29:31,667] [INFO] Start scanning stmt information. [2025-11-18 19:29:31,668] [INFO] Middleware binary start analysis. [2025-11-18 19:29:31,668] [INFO] Middleware binary end of analysis. [2025-11-18 19:29:31,668] [INFO] Middleware package start analysis. [2025-11-18 19:29:31,668] [INFO] Middleware package end of analysis. Csv report is created successfully. The file is located in /home/report/sys-mig_xx.xx.xx.xx_20251118192931/stmt.csv [2025-11-18 19:29:31,681] [INFO] Scanning information successfully completed.
- Collecting information about multiple remote nodes:
Obtain the IP address,
SSH user name/password/port, and scan address of each target server in advance. If a target server has a different architecture from the local server, prepare the software package that is used to collect the target server information. You can run uname -m to query the architecture type.- Encrypt the password for logging in to the target server.
1devkit sys-mig -ec
Enter the text to be encrypted as prompted.
1 2 3 4
please enter the password(the password must contain a maximum of 32 characters): Initializing the working key... Please wait. encrypted password: ***********************************************************************
- Configure the target server information file. The default template file is ./sys-mig/nodes/nodes.conf. For example:
group1 contains two nodes, 192.168.0.2 and 192.168.0.3, and group2 contains the node 192.168.0.4. group2 is a subnode of group1 and inherits the parameter settings in [group1:vars].
1 2 3 4 5 6 7 8 9 10
[group1] 192.168.0.2 ssh_pass=**** scan_dir=/home 192.168.0.3 ssh_pass=**** scan_dir=/home/test,/home/test1 [group1:vars] ssh_user=root ssh_port=22 [group2] 192.168.0.4 ssh_pass=**** scan_dir=/home/test [group1:children] group2
- Collect the ledger information.
1devkit sys-mig -c stmt -d /home/software -mn all
Command output:
[2025-11-27 19:01:41,425] [INFO] Start to execute the command: ./devkit sys-mig -c stmt -cf /usr/local/devkit/sys-mig/resources/sysmig_default.conf -d /home/software -o /usr/local/devkit/sys-mig/report -t /usr/local/devkit/sys-mig/template/stmt_template_default.csv -l 1 -mn all [2025-11-27 19:01:41,425] [INFO] Creating file indexing... [2025-11-27 19:01:41,570] [INFO] Parsing... [2025-11-27 19:01:41,598] [INFO] [multi_node] 192.168.0.2 Connecting to the server... [2025-11-27 19:01:41,599] [INFO] [multi_node] 192.168.0.3 Connecting to the server... [2025-11-27 19:01:41,599] [INFO] Start scanning stmt information. [2025-11-27 19:01:41,600] [INFO] [multi_node] 192.168.0.4 Connecting to the server... [2025-11-27 19:01:41,601] [INFO] Middleware binary start analysis. [2025-11-27 19:01:41,601] [INFO] Middleware binary end of analysis. [2025-11-27 19:01:41,603] [INFO] Middleware package start analysis. [2025-11-27 19:01:41,604] [INFO] Middleware package end of analysis. [2025-11-27 19:01:41,624] [INFO] Scanning information successfully completed. [2025-11-27 19:01:43,590] [INFO] [multi_node] 192.168.0.4 Successfully connected to the server. [2025-11-27 19:01:43,688] [INFO] [multi_node] 192.168.0.3 Successfully connected to the server. [2025-11-27 19:01:43,715] [INFO] [multi_node] 192.168.0.2 Successfully connected to the server. [2025-11-27 19:01:44,057] [INFO] [multi_node] 192.168.0.4 Uploading the collection software package... [2025-11-27 19:01:44,168] [INFO] [multi_node] 192.168.0.3 Uploading the collection software package... [2025-11-27 19:01:44,211] [INFO] [multi_node] 192.168.0.2 Uploading the collection software package... [2025-11-27 19:02:20,499] [INFO] [multi_node] 192.168.0.3 Successfully uploaded the collection software package. [2025-11-27 19:02:20,517] [INFO] [multi_node] 192.168.0.4 Successfully uploaded the collection software package. [2025-11-27 19:02:20,723] [INFO] [multi_node] 192.168.0.2 Successfully uploaded the collection software package. [2025-11-27 19:02:25,755] [INFO] [multi_node] 192.168.0.4 Collecting information about the remote server... Please wait 1 minute. [2025-11-27 19:02:25,918] [INFO] [multi_node] 192.168.0.3 Collecting information about the remote server... Please wait 1 minute. [2025-11-27 19:02:25,986] [INFO] [multi_node] 192.168.0.2 Collecting information about the remote server... Please wait 1 minute. [2025-11-27 19:03:28,336] [INFO] [multi_node] 192.168.0.4 Successfully collected information about the remote server. [2025-11-27 19:03:28,348] [INFO] [multi_node] 192.168.0.4 Downloading the collection result file... [2025-11-27 19:03:29,140] [INFO] [multi_node] 192.168.0.2 Successfully collected information about the remote server. [2025-11-27 19:03:29,146] [INFO] [multi_node] 192.168.0.2 Downloading the collection result file... [2025-11-27 19:03:29,216] [INFO] [multi_node] 192.168.0.3 Successfully collected information about the remote server. [2025-11-27 19:03:29,222] [INFO] [multi_node] 192.168.0.3 Downloading the collection result file... [2025-11-27 19:03:30,994] [INFO] [multi_node] 192.168.0.4 Successfully downloaded the collection result file. [2025-11-27 19:03:31,802] [INFO] [multi_node] 192.168.0.2 Successfully downloaded the collection result file. [2025-11-27 19:03:31,917] [INFO] [multi_node] 192.168.0.3 Successfully downloaded the collection result file. [multi_node] Successfully generated the collection result to /usr/local/devkit/sys-mig/report/sys-mig_xx.xx.xx.xx_20251127190141/stmt.csv. [multi_node] Successfully generated the collection result to /usr/local/devkit/sys-mig/report/sys-mig_xx.xx.xx.xx_20251127190141/stmt_en.csv.
- Encrypt the password for logging in to the target server.
Configuration File Use (-mn/--multi-node)
1 2 3 4 5 6 7 8 9 10 11 12 | [groupName] host key=value [groupName:vars] ssh_port= ssh_user= ssh_pass= soft_path= scan_dir= [groupName:children] groupName [groupName:host] host |
- [groupName]: group name, which consists of letters and digits.
- host key=value: node IP address and parameter values. If multiple parameter values are listed, separate them with spaces. The following parameters are supported:
- ssh_port: port number, 22 by default.
- ssh_user: user name.
- ssh_pass: user password encrypted using the devkit sys-mig -ec command.
- soft_path: If a target server has a different architecture from the local server, designate a directory on the local server to decompress the software package that is used to collect the target server information.
- scan_dir: directories to be scanned on the target server. Separate multiple directories with commas (,).
- [groupName:vars]: global parameter setting of the group. The format is key=value, which can be inherited by child groups.
- [groupName:children]: child group, which specifies the parent-child relationship.
- [groupName:host]: IP addresses of servers in the specified group.
Output Report
Report Type |
Description |
|---|---|
CSV |
Provides server ledger information, including information about server specifications, middleware, and databases. |