The hidden gem 'sosreport' in RHEL and OEL

During a stroll through the filesystem I encountered an executable (a python script actually) called ‘sosreport’. You’ve got to admit: the name sounds intriguing.

The man-page says ‘Generate debugging information for this system’. This is getting even more interesting…

Lets run it!

$ /usr/sbin/sosreport

sosreport (version 1.7)

sosreport requires root permissions to run.

The utility requires root permissions. Not very surprising, root got all permissions to get internal system information.

Again, now as root:

# sosreport

sosreport (version 1.7)

This utility will collect some detailed information about the
hardware and setup of your Red Hat Enterprise Linux system.
The information is collected and an archive is packaged under
/tmp, which you can send to a support representative.
Red Hat will use this information for diagnostic purposes ONLY
and it will be considered confidential information.

This process may take a while to complete.
No changes will be made to your system.

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

Please enter your first initial and last name [localhost]: frits hoogland
Please enter the case number that you are generating this report for: 9999

Progress [###################100%##################][05:15/05:15]

Creating compressed archive...

Your sosreport has been generated and saved in:
/tmp/sosreport-fritshoogland.9999-725705-3400ad.tar.bz2

The md5sum is: 8bac4b5ccbb8c1a79dd6571f293400ad

Please send this file to your support representative.

Let’s see what it provides, and see if it got any benefits above Oracle’s RDA…
It produces two files in /tmp:

-rw-r--r-- 1 root root 33 May 1 14:34 sosreport-fritshoogland.9999-725705-3400ad.tar.bz2.md5
-rw------- 1 root root 631098 May 1 14:34 sosreport-fritshoogland.9999-725705-3400ad.tar.bz2

The list of files when extracting sosreport-fritshoogland.9999-725705-3400ad.tar.bz2 simply is too big to put in the blogpost.
It contains all linux configuration files (yes, that’s a bold statement), all startup/shutdown scripts, all kind of current system information (dmidecode, lsmod, lspci, netstat, iptables, rpm, network routes, LVM, device mapper, EMC multipathing, etc.), could go on and on!

This command is able to let anyone who can get access to the system make a file with all relevant settings for troubleshooting. That’s handy! It’s very hard to get information about network configuration, firewall (iptables), etc. out of inexperienced administrators. This command lets you get all information so you can do the troubleshooting out of the archive instead of a question and answer game with the administrator!

Advertisements
7 comments
  1. PdV said:

    hehe. Thanks for that!
    Seems like an educational thing for most sysamins too.

  2. Thanks for your comment piet!

    Yes, I don’t know any sysadmin who has used or uses this, whilst it is very usefull for diagnosing problems (because it is complete as far as I know).

    Might be even worth considering making an oracle database version for it….

  3. david said:

    Interesting.

    I just saw it and then googled the command which brought me here to your blog .

    I’m just starting admin and so how extract this to see the data enclosed ?

    • .bz2 files are extracted using the ‘bunzip2’ commandline utility on linux.

  4. david said:

    thx much

  5. I can’t find lvm info from sosreport. Can you please tell me where I can find LVM info in sosreport?
    Thanks

  6. A bonus is if you run #sosreport –batch —report it will answer all the questions with the default answer, and add a file to the sosreport folder so it outputs a file that allows you to view the contents of the sosreport as a HTML document.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: