How to generate reports using Linux using the Sosreport command

  
                

Among the many Linux commands, the Sosreport command can generate system diagnostic reports, so that you can keep abreast of the running status of the Linux system. The following small series will introduce you how to use the Sosreport command to generate diagnostic reports. Interested friends can learn under.

Sosreport needs it when you need technical support from RedHat. Redhat's support engineers will ask you for sosreport on the server for troubleshooting.

To run sosreport, you need to install sos package. The sos package is mostly part of the default installation package for linux. If it is not installed for some reason, run the following yum command to install the sos package:

# yum install sos

Generate report

Open the terminal and enter the sosreport command: < Br>

# sosreport

This command will normally complete in a few minutes. Depending on the local configuration, in some cases, some options may take longer to complete. Once completed, sosreport will generate a compressed file in the /tmp directory directory. Different versions use different compression schemes (** gz, bz2, or xz**). This document should be provided to Red Hat's support representative (usually as an attachment if it is open).

Note: sosreport requires root privileges to run.

Different options in the sosreport command:

The sosreport command has a modular structure and allows the user to enable and disable the module and specify the module on the command line. To list the available modules (plugins), use the following command:

# sosreport -l

To disable a module, pass a comma-separated list to -n/–skip -plugins option. For example, kvmand and amd are two modules:

# sosreport -n kvm,amd

Each module can provide additional options with the -k option. For example, the sos rpm module installed in Red Hat Enterprise Linux 5 collects the output of “rpm -Va” by default. Because this is a time-consuming behavior, it can be disabled by the following command:

# sosreport -k rpm.rpmva=off

The above is the way Linux uses the Sosreport command to generate diagnostic reports. The sosreport command is mainly used in CentOS systems and RedHat systems, so the use of the sosreport command is rarely seen in other versions of Linux.

Copyright © Windows knowledge All Rights Reserved