Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install sosreport and supportconfig in Linux to collect system information

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to install sosreport and supportconfig in Linux to collect system information". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Sosreport

Sosreport is a tool of type supportconfig, and sosreport is a tool written by python for most versions of linux, such as centos (like redhat, the package is named sos), ubuntu (under which the package is named sosreport), and so on. The hosting page of sosreport on github is: https://github.com/sosreport/sos, and by default it has been integrated in many system sources. If you are using genuine redhat, when you have a system problem and seek official support, the official will generally analyze and check the collected information through sosreport. It is important to note that in some older redhat distributions it is called sysreport-such as in previous versions of redhat4.5.

1. Installation of sosreport

When installing using the source of the linux distribution by default, the commands used are different because the package names are different on different systems, for example, the installation of redhat and ubuntu platforms is as follows:

The code is as follows:

/ / installation under redhat/centos

# yum-y insatll sos

/ / installation under ubuntu

# sudo apt-get install sosreport

II. Sosreport usage

You can use sosreport-- help or man sosreport to get the help manual, as follows:

The code is as follows:

[root@361way] # sosreport-- help

Usage: sosreport [options]

Options:

-h,-- help show this help message 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 (see

-l)

-a,-- alloptions enable alloptions 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 report 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 operations are also listed above. The-l parameter lists all service plug-ins for the current enable and disable and all plug-ins for the current available.

The code is as follows:

[root@361way log] # sosreport-a-- report

Sosreport (version 3.0)

This command will collect diagnostic and configuration information from

This CentOS Linux system and installed applications.

An archive containing the collected information will be generated in

/ var/tmp and may be provided to a CentOS support representative.

Any information provided to CentOS will be 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 any third party.

No changes will be made to system configuration.

Press ENTER to continue, or CTRL-C to quit.

Please enter your first initial and last name [361way.com]:

Please enter the case number that you are generating this report 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 turn on a general report of all results in html / xml format. The generated package needs to be unpacked with the following command.

The code is as follows:

# xz-d * *. Tar.xz

# tar-xvf * *. Tar

Or directly use the following command to complete the decompression in one step

The code is as follows:

Tar xvJf *. Tar.xz

In the unpacked sos_reports directory, the result sos.html file of report will be generated, and the sos.txt file will be generated at the same time, which lists the specific commands and some information about the copy file.

Due to the large page, only the top part is truncated here, and all the collection modules are listed. The following alerts gives the information of the alarm module. Further down is the information specific to each module.

III. Sosreport configuration file

The configuration file for sosreport is / etc/sos.conf, and the default content is as follows:

The code is as follows:

[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] / / you can set the default enable and disable modules here

# disable = rpm, selinux, dovecot

[tunables] / / adjustable parameters

# rpm.rpmva = off

# general.syslogsize = 15

As can be seen from the configuration file, sosreport also uploads the collected results to server, and you can view the help information of the configuration file through man sos.conf, but man does not give much information. For more information, you can check the wiki page of sosreport on github.

IV. Summary of sosreport

Compared with supportconfig, sosreport is written by python language, so it has more advantages in function expansion, but because of the different versions of python on different distributions, it is relatively troublesome to handle exceptions between different versions. Because supportconfig is a tool written in shell language, it depends relatively less on the version, but it depends on some tools relatively more. For example, when obtaining information related to the process, shell needs to ps the tool or deal with the results of proc, while sosreport can directly import psutil the module. The difference between the two is, in the final analysis, the difference between shell and python.

Supportconfig

1. Installation of supportconfig

You can install through yast or through the zypper command, which is as follows:

Install directly using the source

The code is as follows:

# zypper install supportutils

You can also download the rpm package and install it using yast or look for the installation in the yast administration interface

The code is as follows:

# yast install supportutils-xxx.rpm

Note: depending on the version of the system, the package name may also be supportconfig.

After the installation is completed, you can use rpm-ql supportutils to view the file information contained in the package, as follows:

The code is as follows:

# rpm-ql supportutils

/ etc/schealth.conf

/ etc/supportconfig.conf

/ sbin/chkbin

/ sbin/supportconfig

/ usr/bin/schealth

/ usr/share/man/man5/supportconfig.conf.5.gz

/ usr/share/man/man8/chkbin.8.gz

/ usr/share/man/man8/supportconfig.8.gz

Note: the above results are the results of tests on suse11 sp1 Enterprise Edition, where the directory structure will be slightly different on opensuse 13, using the new version of supportconfig.

II. Supportconfig usage

The following is the help output for supportconfig

The code is as follows:

# supportconfig-h

=

Support Utilities-Supportconfig

Script Version: 2.25,197

Script Date: 2010 04 02

=

Usage: supportconfig [OPTION [OPTION...]]

-h This screen

-An Activates all supportconfig functions with additional logging and full

Rpm verification.

-B Custom tar ball file name element

-C Creates a new default / etc/supportconfig.conf

-D Use defaults; ignore / etc/supportconfig.conf

-E Contact email address

-F Display available supportconfig feature keywords (case-sensitive) used

With-I and-x

-G The GPG recipient's user ID used to encrypt the supportconfig tarball

-H Limit number of included HA Policy engine files

-I Default log file line count

-L Create a full file listing from'/'

-M Contact terminal ID

-N Contact name

-O Contact company name

-P Contact phone number

-Q Run in silent mode

-R Log output directory

-S Limit number of included SAR files

-T Binary execution timeout

-U Sets upload target URL and initiates an upload, supported

Services include: ftp, scp, http, https

-M Contact store ID

-X Max system logs line count

-a Upload the tar ball to the specified alternate target VAR_OPTION_UPLOAD_ALT

-b Screen buffer mode

-d Exclude detailed disk info and scans

-e Search root file system for eDirectory instances;-L implied. Be patient.

-f From directory. Don't collect report files, just use files in that

Directory.

-g Use gzip instead of the default bzip2 compression.

-I

Include keywords. A comma separated list of feature keywords that specify

Which features to include. Use-F to see a list of valid keywords.

-l Gathers additional rotated logs

-m Only gather a minimum amount of info: basic env, basic health, hardware

Rpm, messages, y2logs

-o Toggle listed features on or off

-p Disable all plugins

-q Add a uuid to the tar ball filename to ensure uniqueness

-r

Includes the Novell 11 digit service request number when uploading

The tar ball to Novell

-s Include full SLP service lists

-t Target directory. Just save log files here, do not create tarball.

-u Upload the tar ball to the specified VAR_OPTION_UPLOAD_TARGET.

-v Performs an rpm-V for each installed rpm NOTE: This takes a long time

To complete

-x

Exclude keywords. A comma separated list of feature keywords that specify

Which features to exclude. Use-F to see a list of valid keywords.

-y Only gather the minimum y2log files.

Use Ctrl- to try and skip a function that is hanging.

NOTE:

This tool will create a tar ball in the / var/log directory. Please attach

The log file tar ball to your open Service. Request at the following URL:

Https://secure-support.novell.com/eService_enu

If you cannot attach the tar ball to the SR, then email it to the engineer.

Please submit bug fixes or comments via:

Http://en.opensuse.org/Supportutils#Reporting_Bugs

=

Support Utilities-Supportconfig

Script Version: 2.25,197

Script Date: 2010 04 02

=

When executed by default supportconfig or supportconfig-A, the collected results are packaged into a nts_ hostname _ date .tbz file and a file with the .md5 suffix is generated.

III. Common examples of supportconfig

1. Supportconfig-A collects all logs

The code is as follows:

# supportconfig

=

Support Utilities-Supportconfig

Script Version: 2.25,290

Script Date: 2011 07 14

=

Gathering system information

Data Directory: / var/log/nts_361way.com_140825_1504

Basic Server Health Check... Done

RPM Database... Done

Basic Environment... Done

Basic Health Report... Done

System Modules... Done

Memory Details... Done

Disk I/O... Done

YaST Files... Done

Auditing... Done

Crash Info... Done

NTP... Done

PROC... Done

Boot Files... Done

SLERT... Skipped

Updates... Done

SMT... Skipped

Novell eDirectory... Please Wait... Skipped

Novell LUM... Skipped

Novell NCP... Skipped

Novell NSS... Skipped

Novell DFS... Skipped

Novell SMS... Skipped

Novell NCS... Skipped

Novell AFP... Skipped

Novell CIFS... Skipped

Novell iManager... Skipped

HA Cluster... Skipped

OCFS2... Skipped

DRBD... Skipped

PAM... Done

LDAP... Done

CIMOM... Done

Open Files... Done

Environment... Done

ETC... Done

SYSCONFIG... Done

SYSFS... Done

System Daemons... Done

CRON... Done

AT... Done

UDEV... Done

LVM... Please Wait... Base Detail Done

EVMS... Skipped

Software Raid... Done

Multipathing... Done

Networking... Done

Web... Done

InfiniBand... Done

DNS... Done

DHCP... Done

SLP... Done

SSH... Done

ISCSI... Done

Samba... Done

NFS... Done

AUTOFS... Done

SAR Files... Done

AppArmor... Done

Xen... Done

KVM... Done

X... Done

Printing... Done

SMART Disks... Excluded

Hardware... Please Wait... Done

File System List... Skipped

Supportability Analysis... Please Wait... Done

System Logs... Done

Creating Tar Ball

= = [DONE] =

Log file tar ball: / var/log/nts_361way.com_140825_1504.tbz

Log file size: 4.0M

Log file md5sum: 484b111cda54ca04419facd82a1da7d7

Please attach the log file tar ball to your open Service Request at the

Following URL:

Https://secure-support.novell.com/eService_enu

You can also upload the tar ball to ftp.novell.com/incoming, or just use

Supportconfig-ur, to upload the tar ball automatically.

If you cannot attach the tar ball to the SR, then email it to the engineer.

=

Other common uses:

The code is as follows:

/ / collect the required information with the minimum option

# supportconfig-m

/ / include additional contact information in the output

# supportconfig-E tux@example.org-N "Tux Penguin"-O "Penguin Inc."

/ / to view a complete list of features

# supportconfig-F

/ / only collect information about the usage of a module, such as LVM phase

# supportconfig-I LVM

The function of / /-x is just the opposite of-I, which excludes a module from collecting

# supportconfig-x LVM

/ / use-U url to upload the collected results to the server. Direct services include ftp, scp, http, and https, such as:

# supportconfig-A-U http://www.361way.com/files/

For more information, please refer to the official supportconfig options section.

System health reports collected by supportconfig:

The code is as follows:

# supportconfig-A

# cd / var/log

# tar jxvf nts_361way.com_140825_1504.tbz

# more basic-health-report.txt

# = [Command] = #

# / usr/bin/schealth-Q

#

Supportconfig Health Check Report Tool v1.00-5

Date Checked: 09/12/14 04:40:37

#

Health Check Files [Green]

Processes Waiting for Run Queue [Green]

Kernel Taint Status [Red]

Kernel Tainted: 64 > 0

CPU Utilization [Green]

Interrupts Per Second [Green]

Context Switches Per Second [Green]

Free Memory and Disk Swapping [Green]

Used Disk Space [Green]

Uninterruptible Processes [Green]

Zombie Processes [Green]

#

Status: Red Flag

Checked: / var/log/nts_361way.com_140825_1504/basic-health-check.txt

Report: / var/log/nts_361way.com_140825_1504/basic-health-report.txt

#

In the above report, we found that the kernel Tainted status is red, which is judged by cat / proc/sys/kernel/tainted. If the value is not 0, the kernel is contaminated and the values are different. For more information, please see the / usr/src/linux/Documentation/sysctl/kernel file (the specific value is different, the meaning is also different). The 64 bonus is due to the loading of modules that are not official or open source (Unsupported modules loaded).

IV. Supportconfig configuration file

The default configuration file for supportconfig is / etc/supportconfig.conf, and its default contents are as follows:

The code is as follows:

# cat / etc/supportconfig.conf

# #

# Default Options

# #

OPTION_AFP=1

OPTION_APPARMOR=1

OPTION_AUDIT=1

OPTION_AUTOFS=1

OPTION_BOOT=1

OPTION_CHKCONFIG=1

OPTION_CIFS=1

OPTION_CIMOM=1

OPTION_CRASH=1

OPTION_CRON=1

OPTION_DFS=1

OPTION_DHCP=1

OPTION_DISK=1

OPTION_DNS=1

OPTION_EDIR=1

OPTION_ENV=1

OPTION_ETC=1

OPTION_EVMS=1

OPTION_HA=1

OPTION_HCREPORT=1

OPTION_IB=1

OPTION_ISCSI=1

OPTION_LDAP=1

OPTION_LUM=1

OPTION_LVM=1

OPTION_MEM=1

OPTION_MOD=1

OPTION_MPIO=1

OPTION_NCP=1

OPTION_NCS=1

OPTION_NET=1

OPTION_NFS=1

OPTION_NSS=1

OPTION_NTP=1

OPTION_OCFS2=1

OPTION_OFILES=1

OPTION_PAM=1

OPTION_PRINT=1

OPTION_PROC=1

OPTION_SAM=1

OPTION_SAR=1

OPTION_SLERT=1

OPTION_SLP=1

OPTION_SMART=0

OPTION_SMB=1

OPTION_SMS=1

OPTION_SMT=1

OPTION_SRAID=1

OPTION_SSH=1

OPTION_SYSCONFIG=1

OPTION_SYSFS=1

OPTION_UDEV=1

OPTION_UP=1

OPTION_UPD=1

OPTION_WEB=1

OPTION_X=1

OPTION_XEN=1

ADD_OPTION_EDIR=0

ADD_OPTION_FSLIST=0

ADD_OPTION_LOGS=0

ADD_OPTION_MINDISK=0

ADD_OPTION_MINYAST=0

ADD_OPTION_RPMV=0

ADD_OPTION_SLP=0

VAR_OPTION_BIN_TIMEOUT_SEC=300

VAR_OPTION_CONTACT_COMPANY= ""

VAR_OPTION_CONTACT_EMAIL= ""

VAR_OPTION_CONTACT_NAME= ""

VAR_OPTION_CONTACT_PHONE= ""

VAR_OPTION_CONTACT_STOREID= ""

VAR_OPTION_CONTACT_TERMINALID= ""

VAR_OPTION_CUSTOM_ARCH= ""

VAR_OPTION_GPG_UID= ""

VAR_OPTION_LINE_COUNT=500

VAR_OPTION_LOG_DIRS= "/ var/log / tmp"

VAR_OPTION_MSG_MAXSIZE=500000

VAR_OPTION_PENGINE_FILES_LIMIT=250

VAR_OPTION_SAR_FILES_LIMIT=30

VAR_OPTION_SBM=0

VAR_OPTION_SILENT=0

VAR_OPTION_UNIQUE_FILE=0

VAR_OPTION_UPLOAD_ALT=' https://secure-www.novell.com/upload?appname=supportconfig&file={tarball}'

VAR_OPTION_UPLOAD_TARGET=' ftp://ftp.novell.com/incoming'

The configuration file lists the module information collected by default, company information, mail, phone and uploaded server directory, etc.

V. supportconfig summary

Supportconfig is a very powerful tool written in shell, which can be viewed through vim / sbin/supportconfig. At the same time, because of the versatility of the linux command, we can even simply modify it and port it to other linux distributions. But obviously this is not necessary, because there is a more common open source tool sosreport and its function is similar, and its applicability is stronger, later will list a separate article to make a summary.

This is the end of "how to install sosreport and supportconfig in Linux to collect system information". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report