“sosreport”是一个在 RHEL/CentOS 系统上收集故障排除数据的工具。
它生成调试信息的压缩 tar包,概述 Linux 系统最重要的日志和配置,并将其发送给 Redhat 支持。
除其他外,sosreport 包括有关已安装 rpm 版本、系统日志、网络配置、已安装文件系统、磁盘分区详细信息、已加载内核模块和所有服务状态的信息。
要运行 sosreport,必须安装包“sos”。
这通常是默认安装的,除非系统是使用自定义软件包集安装的。
如果没有安装,可以从yum仓库安装。
确保它是最新的也是一个好主意。
# yum install sos
创建 sosreport 可以像在终端中以 root 身份运行命令一样简单,不带参数:
# sosreport
它将询问与支持案例相关的一些信息:
# sosreport sosreport (version 2.2) This utility will collect some detailed information about the hardware and setup of your Red Hat Enterprise Linux system. The information is collected and an archive is packaged under /tmp, which you can send to a support representative. Red Hat Enterprise Linux will use this information for diagnostic purposes ONLY and it will be considered confidential information. This process may take a while to complete. No changes will be made to your system. Press ENTER to continue, or CTRL-C to quit. Please enter your first initial and last name [geeklab]: orange Please enter the case number that you are generating this report for [None]:
完成后,将在 /tmp 中创建一个压缩的 tar包,以及一个包含 md5sum 的文件,以便支持代表可以验证文件的完整性。
文件名将打印到终端:
Creating compressed archive... Your sosreport has been generated and saved in: /tmp/sosreport-orange-20151011150306-c847.tar.xz The md5sum is: ef729c471178c87582ae422290c1c847 Please send this file to your support representative.
通过在运行 sosreport 命令时设置 TMPDIR 环境变量,可以在 /tmp 以外的其他地方创建 sosreport:
# TMPDIR=/home/jdoe sosreport
之路教程 https://onitr oad .com
其他选项
要在 sosreport 中列出可用插件:
# sosreport -l sosreport (version 2.2) The following plugins are currently enabled: acpid acpid related information anaconda Anaconda / Installation information auditd Auditd related information autofs autofs server-related information bootloader Bootloader information cgroups cgroup subsystem information crontab Crontab information devicemapper device-mapper related information (dm, lvm, multipath) dovecot dovecot server related information filesys information on filesystems ............
如果系统安装了很多包,并且sosreport需要很长时间才能完成,支持可能会要求我们禁用rpm数据库验证(根据rpm数据库验证文件系统上的所有打包文件)
# sosreport -k rpm.rpmva=off
日期:2020-09-17 00:12:12 来源:oir作者:oir