使用命令通过终端工具进行系统迁移应用台账信息收集。
1 | devkit sys-mig -c,--command stmt -cf,--config configure_file_path -src,--source source_file_path -d,--directory scan_path -t,--template stmt_template_path -db,--db-config db_config -mn,--multi-node group_name -o,--output report_dir -l,--log-level {0/1/2/3} -ec,--encipher -v,--version -h,--help |
1 | sys-mig.exe -c,--command stmt -cf,--config configure_file_path -src,--source source_file_path -d,--directory scan_path -t,--template stmt_template_path -o,--output report_dir -l,--log-level {0/1/2/3} -v,--version -h,--help |
参数 |
参数选项 |
说明 |
---|---|---|
-h/--help |
- |
获取帮助信息。 |
-c/--command |
stmt/sbom/mvn_analyse |
收集信息的模式。
|
-cf/--config |
- |
输入参数配置文件路径。支持通过配置文件方式输入参数,默认模板位置为“sys-mig/resources/sysmig_default.conf”,具体使用示例请参见配置文件使用示例。 |
-d/--directory |
- |
输入扫描文件目录,支持输入多个目录,多个目录间以空格分隔。 例如:/home/test1 /home/test2。 |
-src/--source |
- |
输入扫描文件目录,用于统计源码行数。支持输入多个目录,多个目录间以空格分隔。 支持的源代码语言:Java、C、C++、Python、Shell、JS、HTML和CSS。 如果待扫描的目录名称中包含空格,请使用单引号标识该参数。 |
-t/--template |
- |
输入台账扫描结果模板路径,默认按照程序内置模板生成扫描结果。 说明:
默认模板位置为“sys-mig/template/stmt_template_default.csv”。文件有两行数据,第一行是待搜索的信息,第二行是搜索信息对应的内部变量,可删除或更换位置,但不可修改。 |
-o/--output |
- |
报告输出目录,默认为sys-mig二进制所在report目录。 例如:/home/report。 |
-l/--log-level |
0/1/2/3 |
设置日志级别,默认为1。
|
-db/--db-config |
- |
收集数据库信息,支持多节点数据库信息收集,仅支持Linux环境。支持以下两种方式:
|
-mn/--multi-node |
all/ungrouped/groupName |
远程扫描服务器的组名,仅支持Linux环境。配置文件为“sys-mig/nodes/nodes.conf”,具体格式请参见配置文件使用说明(-mn/--multi-node)。 说明:
所有组都放在all组下,未分组的服务器配置放在ungrouped组下。 |
-ec/--encipher |
- |
输入需要加密的文本。 |
-v/--version |
- |
展示程序版本信息,无需输入参数。 |
1 | devkit sys-mig -c stmt -d /home/software -src /opt/code -o /home/report |
返回信息如下:
[2024-03-07 14:24:02,424] [INFO] Start to execute the command: ./devkit sys-mig -c stmt -d /home/software -o /home/report -t /usr/local/devkit/sys-mig/template/stmt_template_default.csv -l 1 -src /opt/code [2024-05-14 16:24:18,817] [INFO] Creating file indexing... [2024-05-14 16:24:18,819] [INFO] Parsing... [2024-05-14 16:24:18,819] [INFO] Start Scanning stmt information. [2024-05-14 16:24:18,820] [INFO] Start to collect database details [2024-05-14 16:24:18,820] [INFO] Database details is collected Successfully [2024-05-14 16:24:18,820] [INFO] Middleware binary start analysis. [2024-05-14 16:24:18,820] [INFO] Middleware binary end of analysis. [2024-05-14 16:24:18,821] [INFO] Middleware package start analysis. [2024-05-14 16:24:18,821] [INFO] Middleware package end of analysis. csv report is created successfully. the file is located in /home/report/sys-mig_xx.xx.xx.xx_20240307142402.csv [2024-05-14 16:24:18,828] [INFO] Scanning information successfully completed.
用户需提前获取目标服务器的IP地址、SSH相关的用户名/密码/端口、扫描地址。当目标服务器与本地服务器架构不一致时,需要准备可适配目标服务器执行信息收集的软件包,架构可通过uname -a查看。
1 | devkit sys-mig -ec |
按照提示输入需要加密的文本:
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: *********************************************************************** |
group1分组下为192.168.0.2/192.168.0.3两个节点,group2分组下为192.168.0.4,group2为group1的子节点,可以继承[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 |
1 | devkit sys-mig -c stmt -d /home/software -mn all |
返回信息如下:
[2024-05-27 11:30:21,041] [INFO] Start to execute the command: ./devkit sys-mig -c stmt -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 [2024-05-27 11:30:21,042] [INFO] Creating file indexing... [2024-05-27 11:30:21,052] [INFO] Parsing... [2024-05-27 11:30:21,094] [INFO] [multi_node] 192.168.0.2 Connecting to the server... [2024-05-27 11:30:21,095] [INFO] Start Scanning stmt information. [2024-05-27 11:30:21,095] [INFO] Start to collect database details [2024-05-27 11:30:21,096] [INFO] [multi_node] 192.168.0.3 Connecting to the server... [2024-05-27 11:30:21,096] [INFO] Database details is collected Successfully [2024-05-27 11:30:21,096] [INFO] [multi_node] 192.168.0.4 Connecting to the server... [2024-05-27 11:30:21,097] [INFO] Middleware binary start analysis. [2024-05-27 11:30:21,097] [INFO] Middleware binary end of analysis. [2024-05-27 11:30:21,098] [INFO] Middleware package start analysis. [2024-05-27 11:30:21,098] [INFO] Middleware package end of analysis. csv report is created successfully. the file is located in /usr/local/devkit/sys-mig/report/sys-mig_xx.xx.xx.xx_20240527113021/stmt.csv [2024-05-27 11:30:21,107] [INFO] Scanning information successfully completed. [2024-05-27 11:30:21,524] [INFO] [multi_node] 192.168.0.2 Successfully connected to the server. [2024-05-27 11:30:21,640] [INFO] [multi_node] 192.168.0.4 Successfully connected to the server. [2024-05-27 11:30:22,024] [INFO] [multi_node] 192.168.0.2 Uploading the collection software package... [2024-05-27 11:30:22,052] [INFO] [multi_node] 192.168.0.4 Uploading the collection software package... [2024-05-27 11:30:22,352] [INFO] [multi_node] 192.168.0.3 Successfully connected to the server. [2024-05-27 11:30:22,922] [INFO] [multi_node] 192.168.0.3 Uploading the collection software package... [2024-05-27 11:30:44,681] [INFO] [multi_node] 192.168.0.4 Successfully uploaded the collection software package. [2024-05-27 11:30:45,009] [INFO] [multi_node] 192.168.0.2 Successfully uploaded the collection software package. [2024-05-27 11:30:45,447] [INFO] [multi_node] 192.168.0.3 Successfully uploaded the collection software package. [2024-05-27 11:30:48,497] [INFO] [multi_node] 192.168.0.4 Successfully collected information about the remote server. [2024-05-27 11:30:48,507] [INFO] [multi_node] 192.168.0.4 Downloading the collection result file... [2024-05-27 11:30:48,767] [INFO] [multi_node] 192.168.0.2 Collecting information about the remote server... Please wait 1 minute. [2024-05-27 11:30:49,396] [INFO] [multi_node] 192.168.0.4 Successfully downloaded the collection result file. [2024-05-27 11:30:49,657] [INFO] [multi_node] 192.168.0.3 Collecting information about the remote server... Please wait 1 minute. [2024-05-27 11:31:50,321] [INFO] [multi_node] 192.168.0.2 Successfully collected information about the remote server. [2024-05-27 11:31:50,332] [INFO] [multi_node] 192.168.0.2 Downloading the collection result file... [2024-05-27 11:31:51,415] [INFO] [multi_node] 192.168.0.2 Successfully downloaded the collection result file. [2024-05-27 11:31:51,703] [INFO] [multi_node] 192.168.0.3 Successfully collected information about the remote server. [2024-05-27 11:31:51,714] [INFO] [multi_node] 192.168.0.3 Downloading the collection result file... [2024-05-27 11:31:53,908] [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_20240527113021/stmt.csv.
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 |
报告类型 |
报告详细说明 |
---|---|
csv |
用于展示服务器台账信息,信息主要包含服务器规格、中间件、数据库等信息。 |