Bug 1304386

Summary: [RFE] Give to user option selective collection logs via sosreport
Product: Red Hat Enterprise Linux 7 Reporter: Yaniv Lavi <ylavi>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED NOTABUG QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.4CC: acathrow, agk, bmr, bugs, didi, gavin, hateya, iheim, jkt, lpeer, lveyde, pdwyer, plambri, Rhev-m-bugs, rmartins, sbonazzo, sbradley, stirabos, vvyazmin, ylavi
Target Milestone: rcKeywords: FutureFeature, Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 973539 Environment:
Last Closed: 2016-02-05 06:44:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 973539    

Description Yaniv Lavi 2016-02-03 13:17:05 UTC
+++ This bug was initially created as a clone of Bug #973539 +++

Description of problem: 
Give to user option selective collection logs via sosreport. We want to allow RHEV users to select which logs to collect to make the collection take less time and have a smaller result.

How reproducible:
100%

Steps to Reproduce:
1. run sosreport tool

Example from real life:
I have RHEVM environment with 50 hosts installed there.
After I found some bug in my environment, and I had to collect logs and attached them to Bugzilla. 
I used with ovirt-log-collector tool for collect my logs that run sosreport.
After 1.5 hour I got zipped file with 3.56 GB size.
  
Actual results:
1. Impossible attached this file to Bugzilla
2. Not all logs are relevant

Expected results:
For example: 
Give to user options collect from host only “vdsm.log” and “libvirtd.log” logs.

Comment 2 Bryn M. Reeves 2016-02-03 13:48:56 UTC
The sos package in RHEL7 does not collect vdsm.log (this is probably collected by the vdsm plugin in the vdsm package shipped with RHEV).

> Give to user options collect from host only “vdsm.log” and “libvirtd.log” logs.

Don't enable the 'vdsm', 'logs', or 'libvirt' plugins as appropriate:

 # sosreport -n logs

 # sosreport -n vdsm

 # sosreport -n libvirt,logs,vdsm

Or whatever combination you want.

Otherwise you can set a global size limit for individual logs that's small enough to only collect the data you want (files exceeding the limit are tailed in the report).

All of these are years old options described in the manual page. We can add more sophisticated controls if needed but it looks like you just need to use the existing capabilities for now.

Comment 3 Yaniv Lavi 2016-02-03 14:25:48 UTC
Can you please provide input on comment #2? Will these option allow us to complete bug 973539?

Comment 4 Sandro Bonazzola 2016-02-05 06:44:58 UTC
(In reply to Bryn M. Reeves from comment #2)
> The sos package in RHEL7 does not collect vdsm.log (this is probably
> collected by the vdsm plugin in the vdsm package shipped with RHEV).

yes, vdsm is shipping a sos plugin within its code. I opened bug #1168500 asking to have it moved from vdsm to sos 2 years ago.


> > Give to user options collect from host only “vdsm.log” and “libvirtd.log” logs.
> 
> Don't enable the 'vdsm', 'logs', or 'libvirt' plugins as appropriate:
> 
>  # sosreport -n logs
> 
>  # sosreport -n vdsm
> 
>  # sosreport -n libvirt,logs,vdsm
> 
> Or whatever combination you want.

I think you meant the opposite, collect only vdsm.log and libvirt.log so
on EL7: sosreport -o libvirt,vdsm


> Otherwise you can set a global size limit for individual logs that's small
> enough to only collect the data you want (files exceeding the limit are
> tailed in the report).
> 
> All of these are years old options described in the manual page. We can add
> more sophisticated controls if needed but it looks like you just need to use
> the existing capabilities for now.

I agree, we can close this as not a bug.

Comment 5 Bryn M. Reeves 2016-02-05 12:51:22 UTC
> I think you meant the opposite, collect only vdsm.log and libvirt.log so
> on EL7: sosreport -o libvirt,vdsm

No, I think I meant what I wrote. The -n option selectively disables plugins, the -o option selectively enables them.

Depending on the outcome you want you can use either (afaik the logCollector script is already using -o to specify a hard-coded list of plugins so you can either remove entries from the list or override them with -n - whichever is most convenient for the existing structure).

Of course, using profiles (--profile=prof1,prof2,...) and the global --log-size option is the preferred method today - we'd have no objection to maintaining a profile for RHEV and oVirt's use upstream that selects just the required plugins and gets rid of the need to maintain plugin lists in another component (which already has broken several times).

Anyway, agreed: NOTABUG.