Questo contenuto non è disponibile nella lingua selezionata.
Chapter 1. Generating an sos report for technical support
With the sos utility, you can collect configuration, diagnostic, and troubleshooting data, and provide those files to Red Hat Technical Support.
1.1. What the sos utility does Copia collegamentoCollegamento copiato negli appunti!
An sos report is a common starting point for Red Hat technical support engineers when performing analysis of a service request for a RHEL system. The sos utility (also known as sosreport) provides a standardized way to collect diagnostic information that Red Hat support engineers can reference throughout their investigation of issues reported in support cases. Using the sos utility helps to ensure that you are not repeatedly asked for data output.
The sos utility allows to collect various debugging information from one or more systems, optionally clean sensitive data, and upload it in a form of a report to Red Hat. More specifically, the three sos components do the following:
sos reportcollects debugging information from one system.NoteThis program was originally named
sosreport. Runningsosreportno longer works assos reporthas to be called instead, with the same arguments.-
sos collectallows to run and collect individualsosreports from a specified set of nodes. -
sos cleanobfuscates potentially sensitive information such as user names, host names, IP or MAC addresses, or other user-specified data.
The information collected in a report contains configuration details, system information, and diagnostic information from a RHEL system, such as:
- The running kernel version.
- Loaded kernel modules.
- System and service configuration files.
- Diagnostic command output.
- A list of installed packages.
The sos utility writes the data it collects to an archive named sosreport-<host_name>-<support_case_number>-<YYYY-MM-DD>-<unique_random_characters>.tar.xz.
The utility stores the archive and its SHA-256 checksum in the /var/tmp/ directory:
ll /var/tmp/sosreport* total 18704 -rw-------. 1 root root 19136596 Jan 25 07:42 sosreport-server1-12345678-2022-01-25-tgictvu.tar.xz -rw-r--r--. 1 root root 65 Jan 25 07:42 sosreport-server1-12345678-2022-01-25-tgictvu.tar.xz.sha256
[root@server1 ~]# ll /var/tmp/sosreport*
total 18704
-rw-------. 1 root root 19136596 Jan 25 07:42 sosreport-server1-12345678-2022-01-25-tgictvu.tar.xz
-rw-r--r--. 1 root root 65 Jan 25 07:42 sosreport-server1-12345678-2022-01-25-tgictvu.tar.xz.sha256
1.2. Installing the sos package from the command line Copia collegamentoCollegamento copiato negli appunti!
To use the sos utility, install the sos package.
Prerequisites
-
You need
rootprivileges.
Procedure
Install the
sospackage.yum install sos
[root@server ~]# yum install sosCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Use the
rpmutility to verify that thesospackage is installed.rpm -q sos sos-4.2-15.el8.noarch
[root@server ~]# rpm -q sos sos-4.2-15.el8.noarchCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.3. Generating an sos report from the command line Copia collegamentoCollegamento copiato negli appunti!
Use the sos report command to gather an sos report from a RHEL server.
Prerequisites
-
You have installed the
sospackage. -
You need
rootprivileges.
Procedure
Run the
sos reportcommand and follow the on-screen instructions. You can add the--uploadoption to transfer thesosreport to Red Hat immediately after generating it.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: If you have already opened a Technical Support case with Red Hat, enter the case number to embed it in the
sosreport file name, and it will be uploaded to that case if you specified the--uploadoption. If you do not have a case number, leave this field blank. Entering a case number is optional and does not affect the operation of thesosutility.Please enter the case id that you are generating this report for []: <8-digit_case_number>
Please enter the case id that you are generating this report for []: <8-digit_case_number>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Take note of the
sosreport file name displayed at the end of the console output.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
You can use the
--batchoption to generate ansosreport without prompting for interactive input.
sudo sos report --batch --case-id <8-digit_case_number>
[user@server1 ~]$ sudo sos report --batch --case-id <8-digit_case_number>
-
You can also use the
--cleanoption to obfuscate a just-collectedsosreport.
sudo sos report --clean
[user@server1 ~]$ sudo sos report --clean
Verification
Verify that the
sosutility created an archive in/var/tmp/matching the description from the command output.sudo ls -l /var/tmp/sosreport* [sudo] password for user: -rw-------. 1 root root 17310544 Sep 17 19:11 /var/tmp/sosreport-server1-12345678-2022-04-17-qmtnqng.tar.xz
[user@server1 ~]$ sudo ls -l /var/tmp/sosreport* [sudo] password for user: -rw-------. 1 root root 17310544 Sep 17 19:11 /var/tmp/sosreport-server1-12345678-2022-04-17-qmtnqng.tar.xzCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.4. Generating and collecting sos reports on multiple systems concurrently Copia collegamentoCollegamento copiato negli appunti!
You can use the sos utility to trigger the sos report command on multiple systems. Wait for the report to terminate and collect all generated reports.
Prerequisites
- You know the cluster type or list of nodes to run on.
-
You have installed the
sospackage on all systems. -
You have
sshkeys for therootaccount on all the systems, or you can provide the root password via the--passwordoption.
Procedure
Run the
sos collectcommand and follow the on-screen instructions.NoteBy default,
sos collecttries to identify the type of cluster it runs on to automatically identify the nodes to collect reports from.-
You can set the cluster or nodes types manually with the
--clusteror--nodesoptions. -
You can also use the
--masteroption to point thesosutility at a remote node to determine the cluster type and the node lists. Thus, you do not have to be logged into one of the cluster nodes to collectsosreports; you can do it from your workstation. -
You can add the
--uploadoption to transfer thesos reportto Red Hat immediately after generating it. -
Any valid
sos reportoption can be further supplied and will be passed to allsosreports executions, such as the--batchand--cleanoptions.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
You can set the cluster or nodes types manually with the
Verification
Verify that the
sos collectcommand created an archive in the/var/tmp/directory matching the description from the command output.ls -l /var/tmp/sos-collector* -rw-------. 1 root root 160492 May 15 13:35 /var/tmp/sos-collector-2022-05-15-pafsr.tar.xz
[root@primary-rhel8 ~]# ls -l /var/tmp/sos-collector* -rw-------. 1 root root 160492 May 15 13:35 /var/tmp/sos-collector-2022-05-15-pafsr.tar.xzCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.5. Cleaning an sos report Copia collegamentoCollegamento copiato negli appunti!
The sos utility offers a routine to obfuscate potentially sensitive data, such as user names, host names, IP or MAC addresses, or other user-specified keywords. The original sos report or sos collect stays unchanged, and a new *-obfuscated.tar.xz file is generated and intended to be shared with a third party.
You can append the cleaner functionality to the sos report or sos collect commands with the --clean option:
[user@server1 ~]$ sudo sos report --clean
Prerequisites
-
You have generated an
sos reportor ansos collecttarball. - (Optional) You have a list of specific keywords beyond the user names, host names, and other data you want to obfuscate.
Procedure
Run the
sos cleancommand on either ansos reportorsos collecttarball and follow the on-screen instructions.-
You can add the
--keywordsoption to additionally clean a given list of keywords. You can add the
--usernamesoption to obfuscate further sensitive user names.The automatic user name cleaning will automatically run for users reported through the
lastlogfile for users with an UID of 1000 and above. This option is used for LDAP users that may not appear as an actual login, but may occur in certain log files.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
You can add the
Verification
Verify that the
sos cleancommand created an obfuscated archive and an obfuscation mapping in the/var/tmp/directory matching the description from the command output.sudo ls -l /var/tmp/sos-collector-2022-05-15-pafsr-private_map /var/tmp/sos-collector-2022-05-15-pafsr-obfuscated.tar.xz [sudo] password for user: -rw-------. 1 root root 160868 May 15 16:10 /var/tmp/sos-collector-2022-05-15-pafsr-obfuscated.tar.xz -rw-------. 1 root root 96622 May 15 16:10 /var/tmp/sos-collector-2022-05-15-pafsr-private_map
[user@server1 ~]$ sudo ls -l /var/tmp/sos-collector-2022-05-15-pafsr-private_map /var/tmp/sos-collector-2022-05-15-pafsr-obfuscated.tar.xz [sudo] password for user: -rw-------. 1 root root 160868 May 15 16:10 /var/tmp/sos-collector-2022-05-15-pafsr-obfuscated.tar.xz -rw-------. 1 root root 96622 May 15 16:10 /var/tmp/sos-collector-2022-05-15-pafsr-private_mapCopy to Clipboard Copied! Toggle word wrap Toggle overflow Check the
*-private_mapfile for the obfuscation mapping:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Keep both the original unobfuscated archive and the *private_map files locally as Red Hat support might refer to the obfuscated terms that you will need to translate to the original values.
1.6. Generating an sos report and securing it with GPG passphrase encryption Copia collegamentoCollegamento copiato negli appunti!
This procedure describes how to generate an sos report and secure it with symmetric GPG2 encryption based on a passphrase. You might want to secure the contents of an sos report with a password if, for example, you need to transfer it over a public network to a third party.
Ensure you have sufficient space when creating an encrypted sos report, as it temporarily uses double the disk space:
-
The
sosutility creates an unencryptedsosreport. -
The utility encrypts the
sosreport as a new file. - The utility then removes the unencrypted archive.
Prerequisites
-
You have installed the
sospackage. -
You need
rootprivileges.
Procedure
Run the
sos reportcommand and specify a passphrase with the--encrypt-passoption. You can add the--uploadoption to transfer thesosreport to Red Hat immediately after generating it.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: If you have already opened a Technical Support case with Red Hat, enter the case number to embed it in the
sosreport file name, and it will be uploaded to that case if you specified the--uploadoption. If you do not have a case number, leave this field blank. Entering a case number is optional and does not affect the operation of thesosutility.Please enter the case id that you are generating this report for []: <8-digit_case_number>
Please enter the case id that you are generating this report for []: <8-digit_case_number>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Take note of the
sosreport file name displayed at the end of the console output.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that the
sosutility created an archive meeting the following requirements:-
File name starts with
secured. -
File name ends with a
.gpgextension. Located in the
/var/tmp/directory.sudo ls -l /var/tmp/sosreport* [sudo] password for user: -rw-------. 1 root root 18381537 Jan 24 17:55 /var/tmp/secured-sosreport-server1-12345678-2022-01-24-ueqijfm.tar.xz.gpg
[user@server1 ~]$ sudo ls -l /var/tmp/sosreport* [sudo] password for user: -rw-------. 1 root root 18381537 Jan 24 17:55 /var/tmp/secured-sosreport-server1-12345678-2022-01-24-ueqijfm.tar.xz.gpgCopy to Clipboard Copied! Toggle word wrap Toggle overflow
-
File name starts with
Verify that you can decrypt the archive with the same passphrase you used to encrypt it.
Use the
gpgcommand to decrypt the archive.sudo gpg --output decrypted-sosreport.tar.gz --decrypt /var/tmp/secured-sosreport-server1-12345678-2022-01-24-ueqijfm.tar.xz.gpg
[user@server1 ~]$ sudo gpg --output decrypted-sosreport.tar.gz --decrypt /var/tmp/secured-sosreport-server1-12345678-2022-01-24-ueqijfm.tar.xz.gpgCopy to Clipboard Copied! Toggle word wrap Toggle overflow When prompted, enter the passphrase you used to encrypt the archive.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the
gpgutility produced an unencrypted archive with a.tar.gzfile extension.sudo ls -l decrypted-sosreport.tar.gz [sudo] password for user: -rw-r--r--. 1 root root 18381537 Jan 24 17:59 decrypted-sosreport.tar.gz
[user@server1 ~]$ sudo ls -l decrypted-sosreport.tar.gz [sudo] password for user: -rw-r--r--. 1 root root 18381537 Jan 24 17:59 decrypted-sosreport.tar.gzCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.7. Generating an sos report and securing it with GPG encryption based on a keypair Copia collegamentoCollegamento copiato negli appunti!
This procedure describes how to generate an sos report and secure it with GPG2 encryption based on a keypair from a GPG keyring. You might want to secure the contents of an sos report with this type of encryption if, for example, you want to protect an sos report stored on a server.
Ensure you have sufficient space when creating an encrypted sos report, as it temporarily uses double the disk space:
-
The
sosutility creates an unencryptedsosreport. -
The utility encrypts the
sosreport as a new file. - The utility then removes the unencrypted archive.
Prerequisites
-
You have installed the
sospackage. -
You need
rootprivileges. - You have created a GPG2 key.
Procedure
Run the
sos reportcommand and specify the user name that owns the GPG keyring with the--encrypt-keyoption. You can add the--uploadoption to transfer thesosreport to Red Hat immediately after generating it.NoteThe user running the
sos reportcommand must be the same user that owns the GPG keyring used to encrypt and decrypt thesosreport. If the user usessudoto run thesos reportcommand, the keyring must also be set up usingsudo, or the user must have direct shell access to that account.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: If you have already opened a Technical Support case with Red Hat, enter the case number to embed it in the
sosreport file name, and it will be uploaded to that case if you specified the--uploadoption. If you do not have a case number, leave this field blank. Entering a case number is optional and does not affect the operation of thesosutility.Please enter the case id that you are generating this report for []: <8-digit_case_number>
Please enter the case id that you are generating this report for []: <8-digit_case_number>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Take note of the
sosreport file name displayed at the end of the console output.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that the
sosutility created an archive meeting the following requirements:-
File name starts with
secured. -
File name ends with a
.gpgextension. Located in the
/var/tmp/directory.sudo ls -l /var/tmp/sosreport* [sudo] password for user: -rw-------. 1 root root 16190013 Jan 24 17:55 /var/tmp/secured-sosreport-server1-23456789-2022-01-27-zhdqhdi.tar.xz.gpg
[user@server1 ~]$ sudo ls -l /var/tmp/sosreport* [sudo] password for user: -rw-------. 1 root root 16190013 Jan 24 17:55 /var/tmp/secured-sosreport-server1-23456789-2022-01-27-zhdqhdi.tar.xz.gpgCopy to Clipboard Copied! Toggle word wrap Toggle overflow
-
File name starts with
Verify you can decrypt the archive with the same key you used to encrypt it.
Use the
gpgcommand to decrypt the archive.sudo gpg --output decrypted-sosreport.tar.gz --decrypt /var/tmp/secured-sosreport-server1-23456789-2022-01-27-zhdqhdi.tar.xz.gpg
[user@server1 ~]$ sudo gpg --output decrypted-sosreport.tar.gz --decrypt /var/tmp/secured-sosreport-server1-23456789-2022-01-27-zhdqhdi.tar.xz.gpgCopy to Clipboard Copied! Toggle word wrap Toggle overflow When prompted, enter the passphrase you used when creating the GPG key.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the
gpgutility produced an unencrypted archive with a.tar.gzfile extension.sudo ll decrypted-sosreport.tar.gz [sudo] password for user: -rw-r--r--. 1 root root 16190013 Jan 27 17:47 decrypted-sosreport.tar.gz
[user@server1 ~]$ sudo ll decrypted-sosreport.tar.gz [sudo] password for user: -rw-r--r--. 1 root root 16190013 Jan 27 17:47 decrypted-sosreport.tar.gzCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.8. Creating a GPG2 key Copia collegamentoCollegamento copiato negli appunti!
The following procedure describes how to generate a GPG2 key to use with encryption utilities.
Prerequisites
-
You need
rootprivileges.
Procedure
Install and configure the
pinentryutility.yum install pinentry mkdir ~/.gnupg -m 700 echo "pinentry-program /usr/bin/pinentry-curses" >> ~/.gnupg/gpg-agent.conf
[root@server ~]# yum install pinentry [root@server ~]# mkdir ~/.gnupg -m 700 [root@server ~]# echo "pinentry-program /usr/bin/pinentry-curses" >> ~/.gnupg/gpg-agent.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
key-inputfile used for generating a GPG keypair with your preferred details. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: By default, GPG2 stores its keyring in the
~/.gnupgfile. To use a custom keyring location, set theGNUPGHOMEenvironment variable to a directory that is only accessible by root.export GNUPGHOME=/root/backup mkdir -p $GNUPGHOME -m 700
[root@server ~]# export GNUPGHOME=/root/backup [root@server ~]# mkdir -p $GNUPGHOME -m 700Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate a new GPG2 key based on the contents of the
key-inputfile.gpg2 --batch --gen-key key-input
[root@server ~]# gpg2 --batch --gen-key key-inputCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enter a passphrase to protect the GPG2 key. You use this passphrase to access the private key for decryption.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm the correct passphrase by entering it again.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the new GPG2 key was created successfully.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
List the GPG keys on the server.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.9. Generating an sos report from the rescue environment Copia collegamentoCollegamento copiato negli appunti!
If a Red Hat Enterprise Linux (RHEL) host does not boot properly, you can boot the host into a rescue environment to gather an sos report.
Using the rescue environment, you can mount the target system under /mnt/sysimage, access its contents, and run the sos report command.
Prerequisites
- If the host is a bare metal server, you need physical access to the machine.
- If the host is a virtual machine, you need access to the virtual machine’s settings in the hypervisor.
- A RHEL installation source, such as an ISO image file, an installation DVD, a netboot CD, or a Preboot Execution Environment (PXE) configuration providing a RHEL installation tree.
Procedure
- Boot the host from an installation source.
In the boot menu for the installation media, select the
Troubleshootingoption.In the Troubleshooting menu, select the
Rescue a Red Hat Enterprise Linux systemoption.At the Rescue menu, select
1and press the Enter key to continue and mount the system under the/mnt/sysimagedirectory.Press the Enter key to obtain a shell when prompted.
Use the
chrootcommand to change the apparent root directory of the rescue session to the/mnt/sysimagedirectory.Optional: Your network will not be up in the inital Rescue Environment, so make sure you set it up first. For example, if the network requires static IP addresses, and you want to transfer the
sosreport over the network, configure the network:Identify the Ethernet device you want to use:
ip link show … 2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 link/ether 52:54:00:74:79:56 brd ff:ff:ff:ff:ff:ff# ip link show … 2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 link/ether 52:54:00:74:79:56 brd ff:ff:ff:ff:ff:ffCopy to Clipboard Copied! Toggle word wrap Toggle overflow Assign an IP address to the network interface, and set the default gateway. For example, if you wanted to add the IP address of 192.168.0.1 with a subnet of 255.255.255.0, which is a CIDR of 24, to device enp1s0, enter:
ip address add <192.168.0.1/24> dev <enp1s0> ip route add default via <192.168.0.254>
# ip address add <192.168.0.1/24> dev <enp1s0> # ip route add default via <192.168.0.254>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add a
nameserverentry to the/etc/resolv.conffile, for example:nameserver <192.168.0.5>
# nameserver <192.168.0.5>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Run the
sos reportcommand and follow the on-screen instructions. You can add the--uploadoption to transfer thesosreport to Red Hat immediately after generating it.Optional: If you have already opened a Technical Support case with Red Hat, enter the case number to embed it in the
sosreport file name, and it will be uploaded to that case if you specified the--uploadoption and your host is connected to the internet. If you do not have a case number, leave this field blank. Entering a case number is optional and does not affect the operation of thesosutility.Take note of the
sosreport file name displayed at the end of the console output.-
If your host does not have a connection to the internet, use a file transfer utility such as
scpto transfer thesosreport to another host on your network, then upload it to a Red Hat Technical Support case.
Verification
Verify that the
sosutility created an archive in the/var/tmp/directory.
1.10. Methods for providing an sos report to Red Hat technical support Copia collegamentoCollegamento copiato negli appunti!
You can use the following methods to upload your sos report to Red Hat Technical Support:
- Upload with the
sos reportcommand Use the
--uploadoption to transfer thesosreport to Red Hat immediately after generating it.If you provide one of the following options:
- a case ID when prompted
-
the
--case-idoption the
--ticket-numberoptionthe
sosutility uploads thesosreport to your case after you authenticate your device.
-
If you do not provide a case number or you do not authenticate your device, the utility uploads the
sosreport to the Red Hat public SFTP site using an anonymous upload. Provide Red Hat Technical Support Engineers with the name and name of the auxiliary user used for the upload so they can access it. Generate and upload the
sosreport to the Red Hat Technical Support:Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you specify the case ID, the output is:
Attempting upload to Red Hat Customer Portal Please visit the following URL to authenticate this device: https://sso.redhat.com/device?user_code=VGEL-PYIM Device authorized correctly. Uploading file to Red Hat Customer Portal Uploaded archive successfully
Attempting upload to Red Hat Customer Portal Please visit the following URL to authenticate this device: https://sso.redhat.com/device?user_code=VGEL-PYIM Device authorized correctly. Uploading file to Red Hat Customer Portal Uploaded archive successfullyCopy to Clipboard Copied! Toggle word wrap Toggle overflow If you do not specify the case ID, the output is:
Attempting upload to Red Hat Secure FTP Please visit the following URL to authenticate this device: https://sso.redhat.com/device?user_code=VGEL-PYIM Device authorized correctly. Uploading file to Red Hat Secure FTP Uploaded archive successfully
Attempting upload to Red Hat Secure FTP Please visit the following URL to authenticate this device: https://sso.redhat.com/device?user_code=VGEL-PYIM Device authorized correctly. Uploading file to Red Hat Secure FTP Uploaded archive successfullyCopy to Clipboard Copied! Toggle word wrap Toggle overflow
- Upload files via the Red Hat Customer Portal
Using your Red Hat user account, you can log into the
Support Casessection of the Red Hat Customer Portal website and upload ansosreport to a technical support case.To log in, visit Support Cases.
- Upload files using the Red Hat Support Tool
With the Red Hat Support Tool, you can upload a file directly from the command line to a Red Hat technical support case. The case number is required.
redhat-support-tool addattachment -c <8-digit_case_number> </var/tmp/sosreport_filename>
[user@server1 ~]$ redhat-support-tool addattachment -c <8-digit_case_number> </var/tmp/sosreport_filename>Copy to Clipboard Copied! Toggle word wrap Toggle overflow