Fixing windows policy loading detection

Changed the detection logic to not collide with OS X
Fix pre-checks in sar module and enable XML output collection

Move the check on the sar logging directory from setup() to a
check_enabled() method and add XML data collection via sadf -x
to allow the collected performance data to be imported by other
tools on the analysis host.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Update SELinux plug-in for modern distributions

The old SELinux module has had no maintenance in some time. Add
the output of the following commands:

 - sestatus -b [ SELinux status and booleans ]
 - selinuxdefcon root
 - selinuxconlist root
 - selinuxexeccon /bin/passwd

Add '-v' to fixfiles command line to produce more verbose output.

Drop all setroubleshoot support - this is an optional package for
all supported distributions and should be handled in a separate
sos plug-in.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Merge pull request #133 from jhjaggars/master

fix OSX policy loading
Add a suggest_filename to e820 map

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Fix modinfo collection

The modinfo collection for the set of loaded modules was using a
nasty handrolled pipeline of lsmod | cut |.. to generate a list
of module names to pass to modinfo.

Rip all that out and replace it with an os.listdir('/sys/module').

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Clean up /proc data collection in kernel plug-in

Reorder the list of collected files so that all *info appear
together to avoid duplication and other errors creeping in.

Get rid of /proc/ksyms (2.4) and replace with /proc/kallsyms.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
ldap.py : improved data collection on Ubuntu/Debian
Merge pull request #136 from karibou/master

Minor fixes and reformat
Merge branch 'new_ldap' of https://github.com/karibou/sosreport

Conflicts:
	sos/plugins/ldap.py
Fix scoping bug in kernel.py

The path "/sys/module" was made into a class variable to avoid
repeating the string through the file. Make sure all uses qualify
the variable appropriately.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Clean up SoSReport.execute()

Reorganise the SoSReport object's execute() method to facilitate
separation of the command line and report generation logic:

 - Rename ensure_plugins() as verify_plugins() and have it return
   a boolean to the execute() method.

 - Push logging down from execute into the individual action
   methods that carry out the tasks being logged.

 - Have execute() return a boolean indicating whether the
   requested operation completed successfully or not.

Longer term it may be better to define an enumeration class for
sos return statuses. This would allow more expression than simple
'pass' or 'fail' and would help the move toward an API.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Rename listPlugins to list_plugins

Rename the option variable listPlugins to list_plugins to conform
with pep8 and other uses in the options set.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Move command line parsing out of SoSReport class

Separate the command line logic from the rest of the SoSReport
class and add a new SoSOptions class to contain it.

SoSOptions may either be initialised from a command line by
passing in an argument list to the initializer or by creating
an empty object and setting values for individual properties.

For now a SoSOptions object is initialized in the SoSReport
initializer (from the argument list passed from __main__).
Eventually this will move into __main__ allowing SoSOptions and
SoSReport to become an interface for external users.

The next step is to move all input validation into the SoSOptions
class (it's currently spread around the code that uses the
options).

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Fix scoping bug in named.py

The path "/etc/named.conf" was made into a class variable to avoid
repeating the string through the file. Make sure all uses qualify
the variable appropriately.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Point sosreport manpage to see the AUTHORS file for updated contributors

- Include AUTHORS file in the tarball.
- Consolidated where list of Authors may be found.

Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
Merge pull request #138 from battlemidget/include-authors-file

Point sosreport manpage to see the AUTHORS file for updated contributors
Add RHEL7 support to RedHatPolicy.rhel_version()

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Break up the device-mapper trainwreck

Break the device-mapper plug-in up into separate plugins for dm
itself and each of the current device-mapper applications:

 - devicemapper.py
 - dmraid.py
 - block.py
 - lvm2.py
 - md.py

The data collection for each subsystem is largely unchanged other
than to fix bugs and remove obsolete items:

 - support for multipath bindings in /var dropped
   (only relevant to RHEL5 and earlier)
 - collect multipath -l separately from -ll
 - fix 'udevinfo' -> 'udevadm info'

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Fix cpu frequency data collection in hardware.py

The cpu frequency reporting on modern systems has moved from
cpufrequtils and the cpufreq command to kernel-tools and the
cpupower command.

Check for the respective packages and run the correct command.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>