aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #103 from battlemidget/patch-1Bryn M. Reeves2013-03-2614-21/+93
|\ | | | | Port several plugins to Debian/Ubuntu
| * Update man page date to reflect recent changes to the informationAdam Stokes2013-03-251-1/+1
| | | | | | | | Signed-off-by: Adam Stokes <hackr@cypherbook.com>
| * Merge git://github.com/sosreport/sosreport into patch-1Adam Stokes2013-03-253-48/+89
| |\ | |/ |/|
* | Clean up command line option handlingBryn M. Reeves2013-03-251-12/+12
| | | | | | | | | | | | | | | | Clean up variable names and description strings in the command line parsing ahead of splitting up the SoSReport class into interface and back-end components. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Man page updatesBryn M. Reeves2013-03-251-26/+64
| |
* | Rename --silent to --quietBryn M. Reeves2013-03-253-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'silent' is a poort name for an option that admits to not being silent: --silent Only display FATAL errors on stdout Rename the option to '--quiet' instead and document it in the man page. It's probably also worth either documenting the fact that UI text is still printed when --quiet is given in non-batch mode or changing interactive mode to only print essential prompts when run with --quiet. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Improve UI text readabilityBryn M. Reeves2013-03-251-2/+2
| | | | | | | | Indent paragraphs in the UI text to improve readability.
| * Conforming naming scheme in a few pluginsAdam Stokes2013-03-256-11/+13
| | | | | | | | | | | | | | Went through a few plugins to make sure inherit distro plugins were keeping same naming scheme as the rest. Signed-off-by: Adam Stokes <hackr@cypherbook.com>
| * Merge branch 'patch-1' of github.com:battlemidget/sosreport into patch-1Adam Stokes2013-03-251-1/+0
| |\
| | * Update __init__.pyAdam Stokes2013-03-251-1/+0
| | | | | | | | | Remove debugging pprint
| * | Inherit system within DebianSystem pluginAdam Stokes2013-03-251-1/+1
| |/ | | | | | | Signed-off-by: Adam Stokes <hackr@cypherbook.com>
| * Fixes #104Adam Stokes2013-03-251-1/+3
| | | | | | | | Signed-off-by: Adam Stokes <hackr@cypherbook.com>
| * Port several plugins to Debian/UbuntuAdam Stokes2013-03-2510-15/+84
|/ | | | | | | | [ Louis Bouchard ] - Ported several plugins to work across Red Hat, Debian and Ubuntu. Signed-off-by: Adam Stokes <hackr@cypherbook.com>
* Merge pull request #102 from sosreport/bmr-template-text-fixesBryn M. Reeves2013-03-255-29/+111
|\ | | | | Fix UI text templating
| * Fix Fedora policy detectionBryn M. Reeves2013-03-221-2/+3
| | | | | | | | | | | | | | | | Make sure that the Fedora policy gets a chance to run by checking for the absence of /etc/fedora-release in the RHEL policy and fix the inheritance of FedoraPolicy. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
| * Improve policy template handlingBryn M. Reeves2013-03-225-29/+110
|/ | | | | | | | | | | | | | | | | The current boilerplate text in the policy class has inconsistent formatting and does not make sense with some distribution names (e.g. Red Hat Enterprise Linux). Fix this by storing the string in paragraphs and formatting it with textwrap and adding new tags to make the construction of the message more flexible: vendor vendor_url vendor_text tmpdir Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Merge pull request #101 from battlemidget/cloud-pluginsBryn M. Reeves2013-03-213-0/+82
|\ | | | | | | | | | | | | | | | | Add modules for Ubuntu cloud infrastructure - Azure hypervisor support - MAAS - Juju
| * Merge git://github.com/sosreport/sosreport into cloud-pluginsAdam Stokes2013-03-181-0/+1
| |\ | |/ |/|
* | Merge pull request #98 from battlemidget/patch-1Bryn M. Reeves2013-03-181-0/+1
|\ \ | | | | | | Line 243 attempts to access non-imported regex
| * | Line 243 attempts to access non-imported regexAdam Stokes2013-02-111-0/+1
| | | | | | | | | This was a result from existing unittests.
| | * 3 New pluginsAdam Stokes2013-03-063-0/+82
| |/ |/| | | | | | | | | | | | | - sos/plugins/azure: Microsoft Azure Agent - sos/plugins/juju: Ubuntu JUJU - sos/plugins/maas: Ubuntu MAAS Signed-off-by: Adam Stokes <hackr@cypherbook.com>
* | Merge pull request #99 from battlemidget/patch-2Bryn M. Reeves2013-02-221-2/+2
|\ \ | |/ |/| Include new-line in shell_out
| * Include new-line in shell_outAdam Stokes2013-02-111-2/+2
|/
* Make add_file() more robustBryn M. Reeves2012-12-181-9/+15
| | | | | | The TarFileArchive with SELinux does not pass the full test archive_tests suite. Catch an uncaught exception when stat'ing a non-existent path and do not allow empty paths in add_parent().
* Force LC_ALL=C for external commandsBryn M. Reeves2012-12-181-1/+6
| | | | | | | | | | Commands run by sos inherit the environment of the user running the program. This includes locale settings meaning that collected output is subject to local language, sorting and formatting customisations that can be undesirable when post-processing or parsing of the gathered data is required. Force all external processes to use the 'C' locale.
* Disable archive recursion tests for TarFileArchiveBryn M. Reeves2012-12-181-10/+14
| | | | | | The TarFileArchive class currently doesn't allow recursive directory addition using the add_file() interface - disable those tests for now.
* Fix import statement in archives_test.pyBryn M. Reeves2012-12-181-1/+1
|
* Separate archive classes from utilities moduleBryn M. Reeves2012-12-185-244/+276
| | | | | | | | | | | | | | | This is the start of the archive reworking to address Issue #86. In this commit the Archive class hierarchy is separated from the generic code in the utilities module and moved into its own 'archive' module. This is taken from the changes committed to Jesse's directory_archive branch. The next step is to decide how we will handle the problems discovered with the in-line tarfile generation (and similar problems affecting Zip files) and whether to revert to building an in-filesystem tree (as Jesse's current branch does) or whether to fix the problems with in-lining post-processing hooks.
* Rename command output collection interfacesBryn M. Reeves2012-12-1764-360/+360
| | | | | | | | | | | The method names for collecting external output are ugly and awkward to type. Rename them to be more consistent with the file collection API and easier to remember and type. This change touches virtually every plugin class but is a very simple search/replace (plugin changes were done with sed). Fixes Issue #92.
* Merge pull request #94 from battlemidget/featureJesse Jaggars2012-12-141-1/+1
|\ | | | | Make Ubuntu/Debian depend on python-selinux (Closed GH:#93)
| * Make Ubuntu/Debian depend on python-selinux (Closed GH:#93)Adam Stokes2012-12-141-1/+1
| | | | | | | | Signed-off-by: Adam Stokes <hackr@cypherbook.com>
* | Add output of ntptime to ntp moduleBryn M. Reeves2012-12-131-1/+4
|/
* Delete vestigial coloured output codeBryn M. Reeves2012-12-132-11/+3
| | | | | | Colour output was removed from sos a long time ago. Kill off the remaining opts variable, command line option and documentation references for increased sanity.
* Remove sar file root symlinksBryn M. Reeves2012-12-131-2/+1
|
* Fix sar file collection and error reportingBryn M. Reeves2012-12-131-3/+5
|
* Fix typo in sar moduleBryn M. Reeves2012-12-131-1/+1
|
* Fix sar plugin error messageBryn M. Reeves2012-12-131-1/+1
|
* Fix exception when unreadable files are collectedBryn M. Reeves2012-12-131-3/+8
| | | | | | | | Files in /proc/, /sys/ and other kernel file systems may have read permissions but not implement a read() syscall. Catch the exception that occurs when accessing these files. Fixes Issue #87
* Fix relative paths in reportsBryn M. Reeves2012-12-132-5/+11
| | | | | | | Fix the relative paths used by the legacy HTML reporting methods and passed by sosreport to the new Report class. Fixes Issue #88
* Change collection of /lib/systemdBryn M. Reeves2012-12-131-1/+6
| | | | | | | Since /lib/systemd contains binaries don't collect the whole thing. Grab /lib/systemd/sysem and /lib/systemd/user as these contain unit files and symlinks but just take a directory listing for /lib/systemd itself and the other subdirectories.
* Teach pam module about multilibBryn M. Reeves2012-12-131-1/+1
| | | | | The pam module collects a list of files in /lib/modules which may be empty on 64-bit systems. Collect both possible paths.
* Do not allow duplicate destinations in TarFileArchive.add_file()Bryn M. Reeves2012-12-121-0/+2
| | | | | | | | | | | | | The logic to ensure we have a proper tar record for each directory in the path of files collected with addCopySpec*() ends up generating lots of duplicate calls to add_file(). Filter them out by checking for the existence of the new destination in tarfile.getnames(). This reduces peak resident memory consumption by 50-75% and cuts run times by 50-66%. Related to Issue #81
* Add profiling to command and file substitution methodsBryn M. Reeves2012-12-121-7/+21
| | | | | | | | | | | | | | | | | | | | | Add profiling calls around the regex substitution methods. Shows that substitution costs are considerable compared to copy: copied: /root/anaconda-ks.cfg time: 0.002293 copied: /var/log/anaconda/anaconda.log time: 0.002204 copied: /var/log/anaconda/syslog time: 0.002709 copied: /var/log/anaconda/anaconda.packaging.log time: 0.002658 copied: /var/log/anaconda/ks-script-YGuewK.log time: 0.002483 copied: /var/log/anaconda/anaconda.program.log time: 0.002416 copied: /var/log/anaconda/anaconda.storage.log time: 0.002263 copied: /var/log/anaconda/anaconda.xlog time: 0.002299 copied: /var/log/anaconda/anaconda.ifcfg.log time: 0.002461 copied: /var/log/anaconda/ks-script-kdAaa4.log time: 0.002558 subst : /root/anaconda-ks.cfg time: 0.021056 I.e. subsituting one file is on average eight times more costly than simple collection.
* Work around non-writable directories in host file systemsBryn M. Reeves2012-12-121-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Distributions that have moved to reduced capabilities and replaced suid and sgid binaries with fscaps have tightened the permissions on several standard system paths. For e.g.: dr-xr-xr-x. 18 root root 4096 Nov 23 19:04 / -rw-r--r--. 1 root root 1174 Dec 11 18:05 /etc/passwd ----------. 1 root root 742 Dec 11 18:05 /etc/shadow dr-xr-x---. 8 root root 4096 Dec 12 19:06 /root Processes that need to write to these paths on the host system must possess cap_dac_override in order to work but in the archive this creates problems when unpacking the archive without this capability. For files this is not a problem since the user only requires write permissions to the containing directory to remove the file. For directories it causes real problems for unprivileged users working with sosreport archives. This includes problems unpacking the archive (since directories are created without write permissions causing subsequent file creation beneath that path to fail) as well as problems cleaning up archives as a typical 'rm -rf' fails to remove these paths. These problems make it impossible to create archives that are both failthful to the host system and easy to work with for typical analysis users. Ultimately this may necessitate dropping permission preservation in the archive and instead storing these (and other information like ACLs and SELinux context) in files within the archive instead). Works around Issue #85
* Add logging to regex subsitution methodsBryn M. Reeves2012-12-121-0/+9
| | | | | | | | | | | | | | Currently we don't log anything when applying file or command output regex substitutions and any errors are silently discarded. This could cause a user to think that passwords etc. have been obscured when in fact they have not. Log our intent to substitute at debug level and log any exception at error level along with the path or glob, module and exception text. Fixes Issue #84
* Re-work sunrpc module to make porting easierBryn M. Reeves2012-12-121-4/+28
| | | | | | | | | | | | | | Re-organise the sunrpc module so that the service check is in the base (Plugin-derived) class but uses a service string defined only in the subclasses. This allows the same checkenabled() to be used for any policy that implements the needed runlevelByService() API. This can serve as a prototype for a generic enabled-by-service facility (mimicking existing files and packages checks) although it currently needs considerable work to review and revise the service and runlevel interfaces in the policy modules. Related to Issue #77
* Use paths list in anaconda pluginBryn M. Reeves2012-12-111-3/+1
| | | | | The previous commit introduced a paths list for the module to collect but did not use it: fix the addCopySpecs call.
* Update anaconda supportBryn M. Reeves2012-12-111-7/+18
| | | | | Update the anaconda module to support new log locations in recent versions.
* Fix regression TarFileArchive regressionBryn M. Reeves2012-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 179d9bb introduced a regression in the TarFileArchive class: (Pdb) bt /usr/sbin/sosreport(23)<module>() -> main(sys.argv[1:]) /usr/lib/python2.7/site-packages/sos/sosreport.py(908)main() -> sos.execute() /usr/lib/python2.7/site-packages/sos/sosreport.py(901)execute() -> return self.final_work() /usr/lib/python2.7/site-packages/sos/sosreport.py(773)final_work() -> self._finish_logging() /usr/lib/python2.7/site-packages/sos/sosreport.py(376)_finish_logging() -> self.archive.add_file(self.sos_log_file.name, dest=os.path.join('sos_logs', 'sos.log')) /usr/lib/python2.7/site-packages/sos/utilities.py(280)add_file() -> self.tarfile.addfile(tar_info, fileobj) /usr/lib64/python2.7/tarfile.py(2015)addfile() -> buf = tarinfo.tobuf(self.format, self.encoding, self.errors) /usr/lib64/python2.7/tarfile.py(996)tobuf() -> return self.create_gnu_header(info) /usr/lib64/python2.7/tarfile.py(1027)create_gnu_header() -> return buf + self._create_header(info, GNU_FORMAT) /usr/lib64/python2.7/tarfile.py(1112)_create_header() -> itn(info.get("mtime", 0), 12, format), > /usr/lib64/python2.7/tarfile.py(212)itn() -> raise ValueError("overflow in number field") The tarinfo mtime field is a float but the pax headers take a string-encoded value. The tarinfo field was inadvertently converted to a formatted string. The problem is hard to track down because it's not always triggered; the bug depends on the value of the string-encoded mtime date.
* Collect file lists for /var/libBryn M. Reeves2012-12-111-0/+2
| | | | | Collect a list of files and directories under /var/lib using ls -lR and tree (if available).