安装 sosreport 包
要运行该工具,请先安装 sos 包:
# yum install sos
之路 on it Road.com
运行 sosreport
我们应该以 root 用户身份运行报告。
该工具的版本与该工具的简短描述及其生成的输出一起显示。
系统会提示我们按 Enter 继续或者按 Ctrl + C 退出。
# sosreport sosreport (version 3.2) This command will collect diagnostic and configuration information from this Red Hat Enterprise Linux system and installed applications. ... Press ENTER to continue, or CTRL-C to quit.
按 Enter 开始。
系统提示我们如下:
Please enter your first initial and last name [host03...]: Please enter the case number you are generating this report for:
我们提供的名称和案例编号成为该工具创建的文件名的一部分。
该工具完成后,我们可以通过运行以下命令解压缩文件并查看内容:
# cd /var/tmp # xz -d [sosfile].xz # tar xvf [sosfile].tar
解压文件会创建一个目录,其中包含多个系统状态命令的输出以及系统上一些配置目录的内容。
以下是在名为 onitroad 的系统上收集的输出示例列表:
# ls /var/tmp/sosreport-onitroad* boot/ etc/ lib/ proc/ sos_commands/ uptime chkconfig free lsmod ps sos_logs/ usr/ date hostname lsof pstree sos_reports/ var/ ...
sosreport 工具收集有关系统的信息,例如硬件配置、安装的软件包、配置和运行状态。
此信息存储在 /var/tmp 目录中的单个压缩文件中,可以将该文件发送给支持代表以帮助解决问题。
sosreport 工具取代了早期版本的工具 sysreport 。
sosreport 插件
sosreport 使用插件,可以打开和关闭。
使用以下命令列出启用和禁用的插件以及插件选项:
# sosreport -l sosreport (version 3.2) The following plugins are currently enabled: abrt Automatic Bug Reporting Tool acpid ACPI daemon information anaconda Anaconda installer anacron Anacron job scheduling service ata ATA and IDE information ... The following plugins are currently disabled: activemq inactive ActiveMQ message broker apache inactive Apache http daemon ceph inactive CEPH distributed storage cluster inactive Red Hat Cluster High Availability and GFS2 cobbler inactive Cobbler installation server ... The following plugin options are available: abrt.backtraces off collect backtraces for every report boot.all-images off collect lsinitrd for all images dmraid.metadata off capture dmraid device metadata filesys.lsof off gathers information on all open files filesys.dumpe2fs off dump filesystem information libraries.ldconfigv off collect verbose ldconfig output ....
还有一些其他选项来控制插件和工具。
选项 | 描述 |
---|---|
-n PLUGNAME | 不要加载指定的插件。 |
-e PLUGNAME | 启用指定的插件。 |
-o PLUGNAME | 仅启用指定的插件,禁用所有其他插件。 |
-k PLUGNAME.PLUGOPT=[VALUE] | 指定插件选项。 |
-a | 为所有加载的插件启用所有(布尔)选项。 |
-tmp-dir DIRECTORY | 指定备用临时目录。 |
-name NAME | 指定要用于存档的名称。 |
-ticket-number NUMBER | 指定要用于存档的票号。 |
日期:2020-09-17 00:12:31 来源:oir作者:oir