Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 479111

Summary: To add a sosplugin to collect lsb_release information
Product: Red Hat Enterprise Linux 5 Reporter: Vimal Kumar <vikumar>
Component: sosAssignee: Adam Stokes <astokes>
Status: CLOSED ERRATA QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: low    
Version: 5.5CC: agk, ahecox, azelinka, bmr, syeghiay
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-30 08:07:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 557292    
Attachments:
Description Flags
sosplugin none

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