2 of 2

Crash Dumps and Support DataLesson 2 of 2

Collecting system information with sos report

Create a support archive with sos report, choose plugins, protect sensitive data and read the archive yourself.

  • sos report
  • sos report --list-plugins
  • sos report -o
  • sos report -n
  • sos clean
  • sos report --batch
  • sha256sum
  • tar
  • rpm -q sos

40 min3 exercises

After this lesson you can

  • Run sos report with a case id, limited plugins and a chosen output directory.
  • Explain what the archive contains and where in it to look first.
  • Obfuscate an archive with sos clean before sharing it, and verify its checksum.

The idea

When you ask someone else for help (a colleague, a vendor, Red Hat Support) the first thing they need is the facts about your machine. Typing them into an email loses most of them. sos report runs a long list of read-only collectors and bundles the results into one compressed archive: configuration files, logs, and the output of many commands, with a checksum so the recipient can verify it arrived intact.

You use it in two directions:

  • Sending: attach the archive to a support case instead of describing the machine.
  • Reading: an archive from another machine (or from yours, an hour before it broke) is a snapshot you can study offline, with grep, without access to the original.

Plugins

The collection is organised into plugins, one per subsystem: networking, systemd, openssh, kernel, selinux, lvm2, block, rpm, logs, and many more. Each plugin knows which files and commands matter for its subsystem. Some plugins are off by default because they are slow or large.

OptionPurpose
--batchDo not ask questions (no confirmation, no case-id prompt)
--case-id IDPut a case or ticket number into the archive name
--label WORDAdd a word to the archive name
-o a,b / --only-pluginsRun only the named plugins
-n a,b / --skip-pluginsSkip these plugins
-e a,b / --enable-pluginsTurn on plugins that are off by default
--list-pluginsShow every plugin and whether it is enabled
--tmp-dir DIRWrite the archive here (default /var/tmp)

On older releases the command was sosreport; both names still work on RHEL, and sos report is the current one.

What the archive looks like

sosreport-HOST-CASE-DATE/
  sos_commands/        output of each command, grouped by plugin  (networking/, systemd/, rpm/, ...)
  etc/                 copies of configuration files
  var/log/             log files (messages, secure, audit when collected)
  proc/, sys/          selected kernel interfaces
  sos_reports/         an HTML index (sos.html) and a JSON manifest
  sos_logs/            how the report itself ran, including plugin errors
  version.txt, date, uptime, hostname, installed-rpms ...

Where to look first: sos_reports/sos.html for an index, sos_commands/systemd/systemctl_list-units_--failed-style files for failed units, var/log/messages and var/log/secure for events, sos_commands/networking/ for addresses and routes, and installed-rpms for the package list. Files keep the name of the command that produced them, so ls and grep -r find things quickly.

Safety

An sos archive contains your configuration, host names, IP addresses, user names and sometimes secrets in configuration files. Treat it as sensitive.

  • sos tries to remove known password fields in some configuration files, but it cannot recognise every secret.
  • sos clean ARCHIVE (also available as sos report --clean) rewrites an archive to replace IP addresses, MAC addresses, host names and domain names with consistent obfuscated values, and writes a mapping file that translates them back. It writes a new archive and leaves the original untouched.
  • The mapping file must stay with you: sending it with the archive undoes the obfuscation.

Try it

sudo sos report --batch --case-id EX342-1
sos report (version 4.x)

This command will collect diagnostic and configuration information from
this Red Hat Enterprise Linux system and installed applications.
...
 Setting up archive ...
 Setting up plugins ...
 Running plugins. Please wait ...

  Starting 12/48 networking     [Running: filesys networking  ...]
  Finished running plugins
Creating compressed archive...

Your sos report has been generated and saved in:
	/var/tmp/sosreport-node1-EX342-1-2026-11-04-abcdefg.tar.xz

 Size	21.43MiB
 Owner	root
 sha256	3e5a...c21f

Please send this file to your support representative.

The archive name encodes host, case, date and a random suffix. Verify and look inside:

cd /var/tmp
sha256sum -c sosreport-node1-EX342-1-*.tar.xz.sha256
tar tf sosreport-node1-EX342-1-*.tar.xz | head -6
sosreport-node1-EX342-1-2026-11-04-abcdefg.tar.xz: OK
sosreport-node1-EX342-1-2026-11-04-abcdefg/
sosreport-node1-EX342-1-2026-11-04-abcdefg/sos_commands/
sosreport-node1-EX342-1-2026-11-04-abcdefg/sos_commands/networking/
sosreport-node1-EX342-1-2026-11-04-abcdefg/etc/
sosreport-node1-EX342-1-2026-11-04-abcdefg/var/log/

A focused report

Fewer plugins means a smaller, faster, safer archive. Only collect what the question needs:

sudo sos report --list-plugins | head
sudo sos report --batch --case-id EX342-2 -o networking,systemd,openssh --tmp-dir /root/cases

Reading an archive offline

Extract just what you need rather than the whole archive:

A=/root/cases/sosreport-node1-EX342-2-*.tar.xz
tar xf $A --wildcards '*/etc/resolv.conf' -O
tar xf $A --wildcards '*/sos_commands/systemd/systemctl_list-units*' -O | head
search lab.example
nameserver 192.168.50.1

Because every file is a plain text copy, the usual tools work: grep -ri 'Failed' */var/log/messages, diff between a “before” and “after” archive, and rpm-style queries against installed-rpms.

Obfuscating before you share

sudo sos clean --batch /root/cases/sosreport-node1-EX342-2-*.tar.xz
ls /root/cases
sosreport-node1-EX342-2-2026-11-04-abcdefg.tar.xz
sosreport-obfuscatedhost1-EX342-2-2026-11-04-abcdefg.tar.xz

The second archive is the one to send. The mapping file (named like *-private_map) stays on your machine.

When it does not work

SymptomCauseFix
sos: command not foundPackage missingdnf install sos
Run takes very long or stalls on a pluginA slow plugin (large rpm verification, big log trees)Skip it with -n, or limit with -o
No space left on device/var/tmp full--tmp-dir on a larger file system
Plugin reports failed to run commandTool for that plugin not installed, or SELinux denialRead sos_logs/sos.log in the archive
Archive contains data you must not shareToo many plugins, secrets in configuration-o fewer plugins, then sos clean, and review before sending
Checksum mismatch at the recipientTruncated uploadUpload again; compare sha256sum on both ends

Going further

Exam and practice. Expect a task that gives you a reason to produce evidence (for example, “collect networking and system information for a support case and store it under a given directory”) and a checker that looks for the archive, its checksum, and which plugins ran. Learn -o, -n, --tmp-dir, --case-id and --list-plugins. Beyond the exam: sos collect gathers reports from several cluster nodes at once, and insights-client uploads a lighter system profile to Red Hat Insights for automated analysis.

Practice

0 of 3 done

Do these on your own system. They get harder. Check each result, then tick it off.

  1. Warm-up

    Create and inspect an archive

    Install sos if needed. Create a report with case id EX342-1 and no questions asked. Find the archive and its checksum file, verify the checksum, and list the first twenty entries of the archive.

    Check your result
    • ls /var/tmp/sosreport-EX342-1.tar.xz shows the archive; a .sha256 file sits beside it.
    • sha256sum -c on that file reports OK (or compare the printed value).
    • tar tf lists directories such as etc/, var/log/ and sos_commands/.
    Hint

    sos report --batch --case-id EX342-1 needs no prompts. The archive name contains the host name, case id and date. The output goes to /var/tmp by default.

    Solution
    sudo dnf install -y sos
    sudo sos report --batch --case-id EX342-1
    ls -lh /var/tmp/sosreport-*EX342-1*
    cd /var/tmp && sha256sum -c sosreport-*EX342-1*.tar.xz.sha256
    tar tf /var/tmp/sosreport-*EX342-1*.tar.xz | head -20
  2. Practice

    Only what the case needs

    The incident concerns networking and the SSH service only. Create a report containing only the networking, systemd and openssh plugins, written to /root/cases, labelled net-ssh. Then list which plugins are available and confirm the archive has no sos_commands/kernel directory.

    Check your result
    • /root/cases/ holds the archive and its checksum file.
    • tar tf shows sos_commands/networking/ and sos_commands/systemd/.
    • tar tf shows no sos_commands/kernel/ entries.
    Hint

    sos report --list-plugins shows plugin names and whether each is enabled. -o plugin1,plugin2 runs only those; -n plugin skips plugins; --tmp-dir sets where the archive is written; --label adds a word to the file name.

    Solution
    sudo mkdir -p /root/cases
    sudo sos report --list-plugins | head -20
    sudo sos report --batch --case-id EX342-2 --label net-ssh -o networking,systemd,openssh --tmp-dir /root/cases
    ls -lh /root/cases
    tar tf /root/cases/sosreport-*net-ssh*.tar.xz | grep -c 'sos_commands/kernel' || true
  3. Challenge

    Anonymise and answer questions from the archive

    Take an archive from the previous exercise. (1) Without extracting it fully, find the machine's default route and its DNS servers from the archive. (2) Produce an obfuscated copy with sos clean that hides IP addresses and the host name, and show that the obfuscated archive no longer contains the original host name. (3) Write the mapping file's location in your notes: why must it never be sent with the archive?

    Check your result
    • Your answers for the default route and DNS match ip route and /etc/resolv.conf on the live machine.
    • sos clean produced a new archive (name contains obfuscated) and a mapping file.
    • tar xOf OBFUSCATED.tar.xz | grep -c "$(hostname)" prints 0 for the path-independent content you tested.
    Hint

    Command output is stored under sos_commands/<plugin>/: networking/ip_route_show_table_all-style files, and etc/resolv.conf is a copy of the file. Extract single files with tar xf ARCHIVE --wildcards '*/etc/resolv.conf'. The mapping lets you translate replies from support back to real names, so it is as sensitive as the data it hides.

    Solution
    A=$(ls /root/cases/sosreport-*net-ssh*.tar.xz | head -1)
    tar xf "$A" --wildcards '*/etc/resolv.conf' -O
    tar tf "$A" | grep -i route | head
    sudo sos clean --batch "$A"
    ls -lh /root/cases
    tar xOf /root/cases/*obfuscated*.tar.xz 2>/dev/null | grep -c "$(hostname)" || true