Bug 479111 - To add a sosplugin to collect lsb_release information
Summary: To add a sosplugin to collect lsb_release information
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: sos
Version: 5.5
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Adam Stokes
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks: 557292
TreeView+ depends on / blocked
 
Reported: 2009-01-07 10:24 UTC by Vimal Kumar
Modified: 2012-11-02 18:31 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-30 08:07:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
sosplugin (1.21 KB, application/octet-stream)
2009-01-07 10:27 UTC, Vimal Kumar
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0201 0 normal SHIPPED_LIVE sosreport bug fix and enhancement update 2010-03-29 12:26:44 UTC

Description Vimal Kumar 2009-01-07 10:24:06 UTC
Description of problem:
---------------------------

We have seen many cases and still are, in which the customer has a corrupt '/etc/redhat-release' file. This may be due to changing the 'redhat-release' package, editing the /etc/redhat-release' file manually, installing third party packages etc...Many times '/etc/redhat-release' output showed Fedora, CentOS etc.. 

We also can see cases in which the file '/etc/redhat-release' itself does not exist and due to this reason, the 'checksysreport' utility won't run. Instead of asking the customer for the exact release or to revert back with more information on this, it would be better to issue a warning on the missing file (or the corrupt content) and then run the checksysreport utility as usual. 

In such a scenario, it would be good to have another criteria such as the output of the command 'lsb_release'. I am not sure if we can use LSB as a standard instead of '/etc/redhat-release', but having more than one reference to confirm the RHEL version would be ideal. 

The following plug-in checks for the existence of the file /etc/redhat-release and generates a warning if it does not exist and also collects the 'lsb_release' output. 

As a suggestion, if '/etc/redhat-release' does not exist (or has a content different from desired) and there is enough information from 'lsb_release', the checksysreport utility must run successfully. This would need editing of the 'checksysreport' utility but first we have to confirm if 'lsb_release' can be used as a standard.

http://en.wikipedia.org/wiki/Linux_Standard_Base
http://www.linuxfoundation.org/en/LSB

How reproducible:
--------------------

Currently the sosreport utility or the existing plug-ins does not collect the output of the command 'lsb_release'.

Steps to Reproduce:
-----------------------

a) Create a new file named 'lsbrelease.py' in the sos plugins directory '/usr/lib/python2.4/site-packages/sos/plugins/'.

b) Add the following content in the file 'lsbrelease.py' :

<snip>
import sos.plugintools
import os

class lsbrelease(sos.plugintools.PluginBase):
    """Linux Standard Base information
    """
    def diagnose(self):
        if not os.path.exists("/etc/redhat-release"):
            self.addDiagnose("/etc/redhat-release missing")
            return
    def setup(self):
        self.collectExtOutput("/usr/bin/lsb_release -a")
        self.collectExtOutput("/usr/bin/lsb_release -d", suggest_filename = "lsb_release", root_symlink = "lsb-release")
        self.addCopySpec("/etc/lsb-release*")
        return  
</snip>

c) The above steps will create the sos plugin named 'lsbrelease'. This plugin can be run individually using the command 'sosreport --only-plugins=lsbrelease'. 

d) The collected details are :

 (i) The output of the command 'lsb_release -a', which collects the details of all the switches available for 'lsb_release'.

 (ii) The output of the command 'lsb_release -d' (which will give a description similar to the output of /etc/redhat-release) and create a link named 'lsb-release' under the main root folder of the sosreport.

 (iii) Collect all the files/folders starting with the name 'lsb-release' under /etc/.

 (iv) Creates a folder named 'lsbrelease' under 'sos_commands' with the output of the commands :

      # lsb_release -a
     
      # lsb_release -d

 (v) If the file /etc/redhat-release does not exists, the message "/etc/redhat-release' is missing" is printed to 'stdout' and the same is stored in <sos_reports/diagnose.txt>.


Additional info:
-----------------

This has been tested on RHEL5/RHEL5.1/RHEL5.2 and RHEL4.6/RHEL4.7.

Comment 1 Vimal Kumar 2009-01-07 10:27:59 UTC
Created attachment 328364 [details]
sosplugin

Comment 3 Suzanne Logcher 2009-05-22 20:24:38 UTC
Since this FutureFeature was not resolved for RHEL 5.4 Beta, it has been moved to RHEL 5.5 for inclusion consideration.

Comment 8 errata-xmlrpc 2010-03-30 08:07:42 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0201.html


Note You need to log in before you can comment on or make changes to this bug.