System Component Information Collection Functions
Command Function
Collects system component information in system migration using the terminal tool.
- The tool can scan data and configurations of Spring (Boot/Spring Framework/Spring MVC), MyBatis (iBatis/MyBatis/MyBatis Plus), Tomcat, and Redis. The result folder is stored in the source directory of the report generation directory.
- You can configure the software compatibility list using the files in the ./sys-mig/resources/sysmig/compatibility_extend directory. During subsequent component collection, the system reads the compatibility information configured by the user. For details, see Compatibility List Configuration.
Syntax
- Linux:
1devkit sys-mig [-h | --help] [-c sbom | --command sbom] [-cf configure_file_path | --config configure_file_path] [-d scan_path | --directory scan_path] [-o report_dir | --output report_dir] [-f {html/json} | --format {html/json}] [-e {version/checkOutPath} | --exclude-fields {version/checkOutPath}] [-l {0,1,2,3} | --log-level {0,1,2,3}] [-mn group_name | --multi-node group_name] [-pid pid | --process_id pid] [-pname pname | --process_name pname] [-ec | --encipher] [-v | --version]
- Windows:
1sys-mig.exe [-h | --help] [-c sbom | --command sbom] [-cf configure_file_path | --config configure_file_path] [-d scan_path | --directory scan_path] [-o report_dir | --output report_dir] [-f {html/json} | --format {html/json}] [-e {version/checkOutPath} | --exclude-fields {version/checkOutPath}] [-l {0,1,2,3} | --log-level {0,1,2,3}] [-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 system component information. You can enter multiple directories and separate them with spaces. Example: /home/test1 /home/test2 |
-o/--output |
- |
Report output directory, which defaults to the report directory where the sys-mig binary file is located. Example: /home/report |
-f/--format |
html/json |
Scan report format, which defaults to html. If you enter multiple formats, separate them with spaces.
|
-e/--exclude-fields |
version/checkOutPath |
Parameter information to be hidden. You can select multiple parameters at the same time. Separate multiple parameters with spaces.
|
-l/--log-level |
0/1/2/3 |
Log level, which defaults to 1. This parameter is optional.
|
-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. |
-pid/--process_id |
- |
This parameter is available only to Java applications. Dynamically scans Java applications with specified process IDs (PIDs). This parameter has no mapping with -pname. You can enter multiple PIDs and separate them using spaces. |
-pname/--process_name |
- |
This parameter is available only to Java applications. Dynamically scans Java applications with specified process names. This parameter has no mapping with -pid. You can enter multiple process names and separate them using spaces. |
-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/jar directory and export the scan report to the /home/report directory.
1devkit sys-mig -c sbom -d /home/jar -o /home/report
Command output:
[2024-05-14 16:26:17,245] [INFO] Start to execute the command: ./devkit sys-mig -c sbom -d /home/jar -o /home/report -f html -l 1 [2024-05-14 16:26:17,245] [INFO] Creating file indexing... [2024-05-14 16:26:17,252] [INFO] Parsing... [2024-05-14 16:26:17,252] [INFO] Middleware binary start analysis. [2024-05-14 16:26:17,252] [INFO] Middleware binary end of analysis. [2024-05-14 16:26:17,253] [INFO] Middleware package start analysis. [2024-05-14 16:26:17,253] [INFO] Middleware package end of analysis. [2024-05-14 16:26:17,253] [INFO] Java software package start analysis. [2024-05-14 16:26:17,254] [INFO] Scan completed successfully. Clear the tmp directory. [2024-05-14 16:26:17,254] [INFO] Analyzing. The dependency is being established. [2024-05-14 16:26:17,254] [INFO] Analysis completed. Converting to the standardized sbom format. [2024-05-14 16:26:17,254] [INFO] Converted to the standard sbom format successfully. [2024-05-14 16:26:17,254] [INFO] Java software package end of analysis. [2024-05-14 16:26:17,255] [INFO] Start parsing hardware info ... [2024-05-14 16:26:17,255] [INFO] Parsing CPU info. [2024-05-14 16:26:17,374] [INFO] Parsing memory info. [2024-05-14 16:26:17,375] [INFO] Parsing disk info. [2024-05-14 16:26:17,376] [INFO] Parsing hardware info succeed. [2024-05-14 16:26:17,376] [INFO] Start parsing OS info ... [2024-05-14 16:26:17,376] [INFO] Parsing kernel info. [2024-05-14 16:26:17,389] [INFO] Parsing kernel modules. [2024-05-14 16:26:17,396] [INFO] 86 kernel modules in total, please wait. [2024-05-14 16:26:17,689] [INFO] Parsing rpm packages. [2024-05-14 16:26:17,834] [INFO] 698 rpm packages in total, please wait. [2024-05-14 16:26:23,946] [INFO] Parsing OS info succeed. Html report is created successfully. The file is located in /home/report/sys-mig_xx.xx.xx.xx_20240514162617/sbom.html. Json file is created successfully. The file is located in /home/report/sys-mig_xx.xx.xx.xx_20240514162617/sbom.json.
- 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 system component information.
1devkit sys-mig -c sbom -d /home/software -mn all
Command output:
[2024-05-27 11:34:12,449] [INFO] Start to execute the command: ./devkit sys-mig -c sbom -d /home/software -o /usr/local/devkit/sys-mig/report -f html json -l 1 -mn all [2024-05-27 11:34:12,449] [INFO] Creating file indexing... [2024-05-27 11:34:12,469] [INFO] Parsing... [2024-05-27 11:34:12,510] [INFO] [multi_node] 192.168.0.2 Connecting to the server... [2024-05-27 11:34:12,512] [INFO] [multi_node] 192.168.0.3 Connecting to the server... [2024-05-27 11:34:12,512] [INFO] Middleware binary start analysis. [2024-05-27 11:34:12,513] [INFO] [multi_node] 192.168.0.4 Connecting to the server... [2024-05-27 11:34:12,513] [INFO] Middleware binary end of analysis. [2024-05-27 11:34:12,514] [INFO] Middleware package start analysis. [2024-05-27 11:34:12,515] [INFO] Middleware package end of analysis. [2024-05-27 11:34:12,515] [INFO] Java software package start analysis. [2024-05-27 11:34:12,530] [INFO] Start scanning file: mixed.zip. [2024-05-27 11:34:12,531] [INFO] Start scanning file: apache-tomcat-9.0.29.tar.gz. [2024-05-27 11:34:12,534] [INFO] Start scanning file: snappy-java-1.0.5.jar. [2024-05-27 11:34:12,717] [INFO] Start scanning file: netty-transport-4.1.55.Final.jar. [2024-05-27 11:34:12,734] [INFO] [multi_node] 192.168.0.2 Successfully connected to the server. [2024-05-27 11:34:12,831] [INFO] [multi_node] 192.168.0.4 Successfully connected to the server. [2024-05-27 11:34:12,915] [INFO] [multi_node] 192.168.0.2 Uploading the collection software package... [2024-05-27 11:34:12,982] [INFO] [multi_node] 192.168.0.4 Uploading the collection software package... [2024-05-27 11:34:13,663] [INFO] Start scanning file: netty-transport-download.jar. [2024-05-27 11:34:13,814] [INFO] [multi_node] 192.168.0.3 Successfully connected to the server. [2024-05-27 11:34:13,905] [INFO] [multi_node] 192.168.0.3 Uploading the collection software package... [2024-05-27 11:34:14,773] [INFO] Start scanning file: netty-transport-4.1.55.Final.jar. [2024-05-27 11:34:15,014] [INFO] [multi_node] 192.168.0.4 Successfully uploaded the collection software package. [2024-05-27 11:34:15,157] [INFO] [multi_node] 192.168.0.2 Successfully uploaded the collection software package. [2024-05-27 11:34:15,191] [INFO] Start scanning file: leveldbjni-all-1.8.jar. [2024-05-27 11:34:15,374] [INFO] Start scanning file: lz4-java-1.4.0.jar. [2024-05-27 11:34:15,380] [INFO] [multi_node] 192.168.0.3 Successfully uploaded the collection software package. [2024-05-27 11:34:15,485] [INFO] Start scanning file: netty-all-4.1.48.Final.jar. [2024-05-27 11:34:17,653] [INFO] [multi_node] 192.168.0.4 Collecting information about the remote server... Please wait 1 minute. [2024-05-27 11:34:17,703] [INFO] [multi_node] 192.168.0.2 Collecting information about the remote server... Please wait 1 minute. [2024-05-27 11:34:18,651] [INFO] [multi_node] 192.168.0.3 Collecting information about the remote server... Please wait 1 minute. ... [multi_node] Successfully generated the collection result to /usr/local/devkit/sys-mig/report/sys-mig_xx.xx.xx.xx_20240527113412_merged.zip.
- 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 13 14 | [groupName] host key=value [groupName:vars] ssh_port= ssh_user= ssh_pass= soft_path= scan_dir= process_id= process_name= [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 (,).
- process_id: process IDs of the Java applications on the target server to be scanned. Separate multiple process IDs with commas (,).
- process_name: process names of the Java applications on the target server to be scanned. Separate multiple process names 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.
Compatibility List Configuration
You can configure the replacement list, blocklist, and trustlist for software compatibility using the files in the ./sys-mig/resources/sysmig/compatibility_extend directory. The configurable lists are as follows:
- java_replaceable_software_list.json: Java application replacement list.
- java_white_software_list.json: Java application trustlist.
- java_black_software_list.json: Java application blocklist.
- middleware_whitelist.json: middleware trustlist, covering the JDK, middleware, and database.
The built-in lists are stored in the ./sysmig/resources/sysmig/compatibility_builtin directory. However, they have a lower priority than the lists configured by the user. For Java applications, the replacement list, blocklist, and trustlist are applied in descending order.
Example:
- Add an asterisk (*) next to the version specified in middleware_whitelist.json or java_replaceable_software_list.json, indicating that the list is applied to the specified version and later. See the example configuration:
1 2 3 4 5 6 7 8 9 10
{ "rules": { "tomcat": { "versionRule": "8.8.5*" }, "weblogic": { "versionRule": "10.3.6*" } } }
- List all the applicable software versions in java_white_software_list.json and java_black_software_list.json. Separate multiple versions with vertical bars (|). The trustlist indicates being compatible, whereas the blocklist indicates being incompatible. See the example configuration:
1 2 3 4 5 6 7 8 9 10
{ "rules": { "commons-crypto": { "versionRule": "1.0.0|1.1.0" }, "snappy-java": { "versionRule": "1.1.4" } } }
Output Report
Report Type |
Description |
|---|---|
JSON |
Provides metadata information about system components such as Java applications, middleware, OSs, and hardware, such as component names, versions, checkout paths, compatibility, and parent-child relationships between components. |
HTML |
Displays the relationships between system components such as Java applications, middleware, databases, and OSs in a tree diagram, and the basic information about each component, such as the component name, version, checkout path, and compatibility. |