In this post, we will cover how to generate sos report on RHEL 8 and RHEL 9 system.
Sos report is a command line tool in Linux distributions like RHEL and CentOS, which collects system configuration and diagnostic information of your linux box like running kernel version, loaded modules, and system and service configuration files. This command also runs external programs to collect further information, and stores this output in the resulting archive.
Sos report is required when you want to open a case with Red Hat for technical support. Red hat support engineers will require sos report of your server for troubleshooting purpose.
To run sos report , sos rpm package must be installed. Sos package is part of default installation in most of Linux distributions. If for any reason this package is no installed , then use below dnf or yum command to install sos.
$ sudo dnf install -y sos or $ sudo yum install -y sos
Generate sos report on RHEL 8/9
Before RHEL 8, command was ‘sosreport‘ but RHEL 8 on wards, command is ‘sos report‘. To run ‘sos report’ command we need root access or sudo user with admin rights.
To generate the report run following ‘sos report’ command
$ sudo sos report
This command will normally complete within few minutes. Depending on local configuration and the options specified in some cases the command may take longer to finish.
Once completed, sos report will generate a compressed a file under /var/tmp folder as shown below. Different Linux versions may use different compression schemes (gz, bz2, or xz).
Compressed file generated by ‘sos report’ should be attached to Red Hat case while raising it.
In case, your RHEL system has internet connectivity then you can generate and upload sos report using following command,
$ sudo sos report --upload
Above command will prompt you to enter Case ID, Red Hat Customer portal User Name and Password as shown below,
Different Options used in sos report command
The sos report command has a modular structure and allows the user to enable and disable modules and specify module options via the command line. To list available modules (plug-ins) use the following command:
$ sudo sos report -l
To turn off a module using -n/–skip-plugins option, to skip multiple modules specify the module names separated by comma. For instance to disable both the kvm and amd podman run,
$ sudo sos report -n kvm,podman
Individual modules may provide additional options that may be specified via the -k option. For example on RHEL systems, sos rpm module collects “rpm -Va” output by default. As this may be time-consuming, so this behavior may be disabled via,
$ sudo sos report -k rpm.rpmva=off
As we have discussed above that sosreport will saved under /var/tmp folder, in case if you want to save the sos report to an alternate folder the use the parameter “–tmp-dir” followed by absolute path of new folder.
$ sudo sos report --tmp-dir /mnt/log
In case you want to map the ticket number as well while creating sos report then execute the following command,
$ sudo sos report --tmp-dir /mnt/log --ticket-number xxxxxxxx
That’s all from this guide, I have you found it informative, so please do post your queries and feedback in below comments section.
Very useful, thank you!
Out of curiosity, do you happen to know how redhat engineer makes use of the sos report, do they run a script against it, or something else?