Sosreport is a supportconfig tool, Sosreport is a tool written in Python that works for CentOS (like Redhat, package name is SOS), Most versions of Linux, such as Ubuntu (its next package is named Sosreport). The managed pages sosreport on GitHub are: Https://github.com/sosreport/sos, and the default is already integrated in many systems ' sources. If the use of a genuine redhat, in the event of a system problem, seek official support, the official will generally through the sosreport will be collected information analysis. Note that some of the older Redhat distributions are called sysreport------such as the redhat4.5 version.
First, the installation of Sosreport
When you install by default using the Linux distribution source, the commands you use vary depending on the package name on the different systems, such as the Redhat and Ubuntu platforms are installed as follows:
| The code is as follows |
Copy Code |
Installation under Redhat/centos # yum-y Insatll SOS Installation under Ubuntu # sudo apt-get install Sosreport
|
Second, Sosreport usage
You can use the Sosreport--help or man sosreport to get the use Help manual as follows:
| The code is as follows |
Copy Code |
| [Root@361way ~]# Sosreport--help Usage:sosreport [Options] Options: -H,--help show this Help and exit -L,--list-plugins list plugins and available plugin options -N Noplugins,--skip-plugins=noplugins Disable these plugins -E Enableplugins,--enable-plugins=enableplugins Enable these plugins -O Onlyplugins,--only-plugins=onlyplugins Enable these plugins only -K plugopts,--plugin-option=plugopts Plugin options in plugname.option=value format ( -L) -A,--alloptions enable all options for loaded plugins --batch Batch mode-do not prompt interactively --build Keep SOS tree available and dont package results -V,--verbose increase verbosity --quiet only print fatal errors --debug enable interactive debugging using the Python debugger --ticket-number=ticket_number Specify ticket Number --name=customer_name Specify the name --config-file=config_file Specify alternate Configuration file --tmp-dir=tmp_dir Specify alternate temporary directory --report Enable Html/xml Reporting --profile Turn on profiling -Z Compression_type,--compression-type=compression_type Compression technology to use [Auto, zip, gzip, bzip2, XZ] (Default=auto) Some Examples: Enable cluster plugin only and collect DLM Lockdumps: # Sosreport-o Cluster-k Cluster.lockdump Disable memory and Samba plugins, turn off Rpm-va collection: # sosreport-n Memory,samba-k Rpm.rpmva=off Examples of specific actions are also listed above. Where the-l parameter lists all the service plug-ins for the current enable and disable and all plug-ins for the current available. [Root@361way log]# sosreport-a--report Sosreport (version 3.0) This command would collect diagnostic and configuration information from This CentOS Linux system and installed applications. An archive containing the collected information would be generated in /var/tmp and May are provided to a CentOS support representative. Any information provided to CentOS is treated in accordance with The published support policies at: https://www.centos.org/ The generated archive may contain data considered sensitive and its Content should be reviewed by the originating organization before being Passed to no third party. No changes is made to system configuration. Press ENTER to continue, or ctrl-c to quit. Please enter your the initial and last name [361way.com]: Please enter the "Case number" you are generating this is for: Running plugins. Please wait ... Running 68/68:yum ... Creating compressed archive ... Your Sosreport has been generated and saved in: /var/tmp/sosreport-361way.com-20140912204339.tar.xz The checksum is:eaf5b2cbb1e9be68d41be5e5a60a61b6 Please send this file to your support representative. |
As shown above, I use-A to enable all modules,--report is to open all the results in html/xml format for a total report. The resulting package needs to be unpack with the following command.
| The code is as follows |
Copy Code |
# xz-d ***.TAR.XZ # TAR-XVF ***.tar
|
Or simply use the following command to complete the decompression step
Tar xvjf ***.tar.xz
After the package Sos_reports directory will have the results of the sos.html file generation, and there will be Sos.txt file generation, which lists the specific implementation of the command and some information on the copy file. The contents of HTML open are as follows:
Because the page is larger, only the top section is truncated, all the collection modules are listed, and the following alerts gives information about the alarm module. Further down is the specific information to each module.
Third, sosreport configuration file
The Sosreport profile is/etc/sos.conf, and the default content is as follows:
| The code is as follows |
Copy Code |
[Root@361way ~]# cat/etc/sos.conf [General] #ftp_upload_url = ftp://example.com/incoming #gpg_keyring =/usr/share/sos/rhsupport.pub #gpg_recipient = support@redhat.com Smtp_server = None [Plugins]///Here you can set the default enable and disable modules #disable = rpm, SELinux, Dovecot [Tunables]//Adjustable parameters #rpm. Rpmva = Off #general. syslogsize = 15
|
As you can see from the configuration file, Sosreport also uploads the collected results to the server and can view the help information for the profile through man sos.conf, but man does not give much information and wants more information to see Sosreport the wiki page on the GitHub.
Iv. Summary of Sosreport
Compared to Supportconfig, because Sosreport is written in the Python language, it has an advantage in feature extensions, but because of the different versions of Python on different distributions, the exception handling between different versions is relatively cumbersome when functional extensions are performed. and Supportconfig because it is a tool written in the shell language, less dependent on the version, but more dependent on some tools, such as in the acquisition of process-related information, the shell needs to be the PS tool or processing proc results, and Sosreport can import the Psutil module directly, the difference between the two is the difference between shell and Python in the final analysis.