Ali The Expert

Logo

CentOS / RHEL : How to collect sosreport

The “sosreport” is a tool to collect troubleshooting data on RHEL/CentOS systems. It generates a compressed tarball of debugging information that gives an overview of the most important logs and configuration of a Linux system, to be sent to Redhat Support. Among other things, the sosreport includes information about the installed rpm versions, syslog, network configuration, mounted filesystems, disk partition details, loaded kernel modules and status of all services. 

To run sosreport, the package “sos” must be installed. This is usually installed by default, unless the system was installed with a custom package set. If it is not installed, it can be installed from the yum repository. It is also a good idea to make sure it is up to date.
# yum install sos
To create the sosreport can be as simple as running the command in a terminal, without arguments, as root:
# sosreport
It will ask for some information related to a support case:

# 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]: Sandeep
Please enter the case number that you are generating this report for [None]:

On completion, a compressed tarball will be created in /tmp, along with a file containing the md5sum so that the file’s integrity can be verified by the support representative. The filename will be printed to the terminal:

Creating compressed archive…

Your sosreport has been generated and saved in:
/tmp/sosreport-Sandeep-20151011150306-c847.tar.xz 

The md5sum is: ef729c471178c87582ae422290c1c847

Please send this file to your support representative.

It is possible to have the sosreport created somewhere other than /tmp by setting the TMPDIR environment variable when running the sosreport command:
# TMPDIR=/home/jdoe sosreport

Additional options

To list available plugins in 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
…………

If the system has a lot of packages installed, and sosreport takes a long time to complete, support may request that you disable the rpm database verification (verifies all packaged files on the filesystem against the rpm database)
# sosreport -k rpm.rpmva=off

How generate SOS Report on Different location..

sosreport –tmp-dir /home/sosreport sosreport –tmp-dir /home/sosreport Muhammad Ali, Today at 9:58 PM