aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix dmraid metadata collection and make it optionalBryn M. Reeves2014-04-141-1/+8
| | | | | | | | | | | | The dmraid command writes metadata dumps into the current working directory. This is normally /tmp meaning that the files are created outside the archive. Use runat to change directory to the appropriate path in the archive before running the command and add an option to control metadata collection. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Document dmraid optionsBryn M. Reeves2014-04-141-0/+7
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Remove shell pipeline from OpenStack Nova pluginBryn M. Reeves2014-04-141-1/+1
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Remove shell redirects from OpenStack Nova pluginBryn M. Reeves2014-04-141-8/+8
| | | | | | | Shell redirect syntax is no longer supported and will fail. Remove its use from the OpenStack Nova plugin. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Add default Plugin.setup() methodBryn M. Reeves2014-04-143-8/+4
| | | | | | | | | | | | | | | | | | | Adding a default setup() method to the base Plugin class allows useful plugins to be written declaratively by setting the 'files' and 'packages' members of the subclass, e.g.: class FooPlugin(Plugin): plugin_name = 'foo' packages = ('foo',) files = ('/etc/foo.conf',) Creates a plugin class named 'foo' that will run whenever the 'foo' package is installed or the '/etc/foo.conf' file exists. The method calls self.add_copy_specs() with the plugin's files list. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Really fix file and command collection regressionsBryn M. Reeves2014-04-105-8/+8
| | | | | | | | | | | | | | | | | | | | | | | Previous patch was missing the hunks for plugins other than usb: modified: sos/plugins/general.py modified: sos/plugins/logs.py modified: sos/plugins/networking.py modified: sos/plugins/qpid.py modified: sos/plugins/s390.py The automation used to convert to add_copy_specs() and add_cmd_outputs() left a few missing and stray commas in file and command lists, for e.g. causing two lsusb commands to be concatenated: Running 71/74: usb... [plugin:usb] collecting path '/sys/bus/usb' [plugin:usb] collecting output of 'lsusblsusb -v' [plugin:usb] collecting output of 'lsusb -t' Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Fix file and command collection regressionsBryn M. Reeves2014-04-091-1/+1
| | | | | | | | | | | | | | The automation used to convert to add_copy_specs() and add_cmd_outputs() left a few missing and stray commas in file and command lists, for e.g. causing two lsusb commands to be concatenated: Running 71/74: usb... [plugin:usb] collecting path '/sys/bus/usb' [plugin:usb] collecting output of 'lsusblsusb -v' [plugin:usb] collecting output of 'lsusb -t' Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Combine debian and ubuntu basic log gathering classesAdam Stokes2014-04-091-11/+2
| | | | | | | The plugin list shows logs twice for Ubuntu and Debian systems. Since the variations between the 2 are minimal we are combining those classes. Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Replace os.system() in gluster plugin with self.check_ext_prog()Bryn M. Reeves2014-04-081-8/+9
| | | | | | | | Plugins should not open-code calls to external commands. Use the build-in check_ext_prog() interface instead and test for success before attempting to collect the statedump files. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Allow failures for python 3.4 on travis-ciAdam Stokes2014-04-071-0/+3
| | | | | | | | Looks like python 3.4 is not ready available on travis-ci.org. We'll make 3.4 unit testing a requirement once travis-ci makes python 3.4 an available environment. Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Bring python 3.4 into the testing matrixAdam Stokes2014-04-071-0/+1
| | | | Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Merge pull request #265 from karibou/fix_interfaces.dBryn M. Reeves2014-04-071-0/+1
|\ | | | | Add collection of /etc/network/interfaces.d for Ubuntu
| * Add collection of /etc/network/interfaces.d for UbuntuLouis Bouchard2014-04-071-0/+1
|/ | | | | | | | Since 14.04 Trusty, ubuntu uses config scripts in /etc/network/interfaces.d. Collect those. Closes: #264 Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>
* Add add_cmd_outputs() and convert plugins to use itBryn M. Reeves2014-04-0685-696/+950
| | | | | | | | | | Add a new method to Plugin to add a list of commands to be run, analogous to add_copy_specs() vs add_copy_spec(). Also convert a few plugins not using add_copy_specs() for long file lists (or using it inconsistently). Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Handle ENOENT in sos_get_command_output()Bryn M. Reeves2014-04-061-1/+8
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Call Popen with shell=FalseBryn M. Reeves2014-04-061-1/+3
| | | | | | Fixes Issue #253. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Make rpm plugin call sh -c'...'Bryn M. Reeves2014-04-061-6/+6
| | | | | | | The rpm plugin is the last user of shell syntax. For now have it call its pipeline explicitly using sh -c '...'. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Make OpenShift plugin use the runat parameterBryn M. Reeves2014-04-061-1/+2
| | | | | | | | | | OpenShift uses 'cd /path && cmd' in a call to add_cmd_output(). Replace this with the runat paramter and avoid shell syntax in the plugin. Related: Issue #253. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Add 'runat' parameter to command output interfacesBryn M. Reeves2014-04-062-14/+36
| | | | | | | | | Add a new 'runat' parameter sos_get_command_output() to specify a directory for the child to switch to before executing the given command and propagate this through the various command output collection interfaces. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Remove pipe use from autofs pluginBryn M. Reeves2014-04-061-3/+0
| | | | | | | | | This is redundant since the whole ps and mount output is captured elsewhere. Also removes shell syntax from the plugin. Related: Issue #253. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Remove pipe use from soundcard pluginBryn M. Reeves2014-04-061-3/+0
| | | | | | | | | This is redundant since the whole lspci and lsmod output is captured elsewhere. Also removes shell syntax from the plugin. Related: Issue #253. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Remove dmesg|grep use from memory pluginBryn M. Reeves2014-04-061-3/+0
| | | | | | | | | | This is redundant since the whole boottime dmesg (and current dmesg buffer) are captured elsewhere. Also removes shell syntax from the plugin. Related: Issue #253. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Restore generic UI preamble textBryn M. Reeves2014-04-062-11/+27
| | | | | | | | | | The generic UI text in the policy base class was replaced with the Red Hat Enterprise Linux wording in commit c59877c. The wording isn't suitable for all distributions so revert this part of the commit and move the RHEL text back to the RHEL-specific policy class. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Logging improvementsBryn M. Reeves2014-04-068-44/+93
| | | | | | | | | | | | | | | | | Improve logging output and make consistent use of log levels in plugin code. Log messages for the archive and plugin classes now use their own class-level logging interface to prefix messages with a label indicating the message source, e.g.: [plugin:yum] collecting output of 'yum -C repolist' [archive:TarFileArchive] finalizing archive '/var/tmp/sosreport-f20-vm1-20140406162540' Convert existing plugin and archive code to use the new interfaces. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Handle copystat() exceptions in FileCacheArchive.add_string()Bryn M. Reeves2014-04-061-0/+3
| | | | | | | | Since add_string() attempts to copystat() strings that exist in the host file system it also needs to check for PermissionError exceptions. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Make add_file() exception logging consistentBryn M. Reeves2014-04-061-3/+3
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Break up exception handling in FileCacheArchive.add_file()Bryn M. Reeves2014-04-061-2/+9
| | | | | | | | | | | | | | An exception can occur at several points in add_file() - Copying the source to the destination - Propagating permissions with shutil.copystat - Setting ownership via os.chown The second of these can occur when copying SELinux xattrs from /proc. Separate out the three cases and ignore failures in copystat. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Fix typo in PowerPC pluginBryn M. Reeves2014-04-061-2/+2
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Update references to github URLBryn M. Reeves2014-04-065-6/+6
| | | | | | Update URLs to reflect repository rename to 'sos'. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Convert PowerPC plugin to use add_copy_specs()Bryn M. Reeves2014-04-041-14/+20
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Replace kvm os.popen use with Plugin.call_ext_prog()Bryn M. Reeves2014-04-041-7/+14
| | | | | | | Use call_ext_prog() to mount/umount debugfs and check for errors before running kvm_stat. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Syntax error.. I blame emacs.Adam Stokes2014-04-041-1/+1
| | | | Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Properly state unicode literal in Python 3.2Adam Stokes2014-04-041-1/+1
| | | | | | | The 'u' prefix wasn't reintroduced back into Python 3 until version 3.3. Use six here to accomodate for that. Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Pass byte strings to six.binary_typeBryn M. Reeves2014-04-041-1/+1
| | | | | | Python3 needs a byte string as argument to six.binary_types. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* add python 3.2 for Ubuntu Precise releaseAdam Stokes2014-04-041-0/+1
| | | | Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Use six.binary_type to produce a .decode()able stringBryn M. Reeves2014-04-041-1/+1
| | | | | | | | | Python3 strings do not have a .decode() method. When clearing output for command-not-found case use binary_type("") instead of the empty string. This gives a bytestring on python3 which does support the decode() method. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Use input method from python sixAdam Stokes2014-04-043-6/+10
| | | | | | | | | Something our unittests didnt catch which is more functional than anything. Using raw_input fails on python3 because it was renamed to input. Six provides an alias that handles both cases. Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Fix tuna collection in kernelrtBryn M. Reeves2014-04-041-2/+3
| | | | | | | | | | | The path to the 'head' binary was mangled in the automated PATH conversion (commit e0d132e). It's not required anyway - we might as well grab the entire output. Also remove a useless package check before running the command. Fixes Issue #254. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Clean up sos_get_command_output() and friendsBryn M. Reeves2014-04-047-47/+60
| | | | | | | | | | | | | Returning a 3-tuple has always been ugly. It gets worse as the parameter list for this family of functions grows. Worse, the 3rd member of the tuple is unused and is always set to 0. Rip the whole mess out and return a single, simple dictionary object with 'status' and 'output' keys. Update utilities_tests to reflect the new interface. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Clean up utilities.sos_get_command_output()Bryn M. Reeves2014-04-041-14/+13
| | | | | | | | Remove dead code and clean up the logic in sos_get_command_output. This paves the way for simplifying parameter and return passing in the Plugin command output entry points. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Make forbidden path test a separate functionBryn M. Reeves2014-04-031-4/+7
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Fix whitespace in Plugin classBryn M. Reeves2014-04-031-1/+1
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Add Plugin.do_path_regex_sub()Bryn M. Reeves2014-04-031-0/+12
| | | | | | | | | | | Add a method to the Plugin class to apply a regex substitution to a set of paths maching a path regex. For e.g.: self.do_path_regex_sub(r'/etc/foo.*', 'pw=(.*)', 'pw=****') The oVirt plugin will use this. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Add mail notification to sos-devel in travis configurationBryn M. Reeves2014-04-031-1/+2
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Update cgred configuration file path for RedHatCgroupsBryn M. Reeves2014-04-021-1/+1
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Refactor cgroups pluginBryn M. Reeves2014-04-021-14/+16
| | | | | | | | Move common files from DebianCgroups to Cgroups and drop separate DebianPlugin class. Make add_copy_specs() invocations conform to recommended indent style. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Add collection of /var/log/cloud-init.log andLouis Bouchard2014-04-021-0/+1
| | | | | | | | /var/log/cloud-init-output.log if they exist. Closes: #250 Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com> Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Update travis-ci build status imageAdam Stokes2014-04-011-1/+1
| | | | Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Use := with gmake shell function for better optimizationAdam Stokes2014-04-011-5/+5
| | | | | | Also updated the REPO variable to point to new vcs location Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Collect network interfaces flagsMichele Baldessari2014-03-312-1/+3
| | | | | | | | | | | | | | The output of ifconfig or ip link is not enough to understand the full state of the network card flags. In particular IFF_PROMISC is set on a a bridge port-member but that is not displayed via ifconfig nor ip link. See also https://bugzilla.redhat.com/show_bug.cgi?id=199979c#17 why we need to do this. Closes #245 Signed-off-by: Michele Baldessari <michele@acksyn.org> Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>