aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [gnocchi] convert add_copy_spec_limit -> add_copy_specBryn M. Reeves2017-03-281-4/+4
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [plugins] remove add_copy_spec_limit() - it is now add_copy_spec()Michael Adam2017-03-281-4/+1
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] move the glob tests togetherMichael Adam2017-03-281-4/+4
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] remove duplicate plugin testsMichael Adam2017-03-281-11/+0
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] let all copy_spec tests use add_copy_spec()Michael Adam2017-03-281-9/+9
| | | | | | instead of add_copy_spec_limit() Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] let all plugins use add_copy_spec() instead of add_copy_spec_limit()Michael Adam2017-03-2840-174/+129
| | | | | | | | The difference between add_copy_spec() has been removed. This is in preparation of removing the add_copy_spec_limit() special case altogether. Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] extend the signature of add_copy_spec() to match add_copy_spec_limit()Michael Adam2017-03-281-2/+2
| | | | | | This is in preparation of converging to one add_copy_spec() function Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] implement add_copy_spec() by calling add_copy_spec_limit()Michael Adam2017-03-281-14/+1
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] Add tests for add_copy_spec_limit() with multiple copyspecsMichael Adam2017-03-281-0/+8
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] use _expand_copy_spec in add_copy_spec_limitMichael Adam2017-03-281-1/+1
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] make add_copy_spec_limit understand lists of copyspecsMichael Adam2017-03-281-31/+42
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] add tests for add_copy_spec_limit()Michael Adam2017-03-281-0/+13
| | | | | | | - a test with a single file without limit - a test with a single glob without limit Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] add test for multiple arguments to add_copy_spec()Michael Adam2017-03-282-0/+5
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] move comment structuring the add_copy_spec_limit testsMichael Adam2017-03-281-2/+2
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] add an extra blank line for separation in plugin_testsMichael Adam2017-03-281-0/+1
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] fix trailing whitespace in plugin_testsMichael Adam2017-03-281-1/+1
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] Make the test_glob_file_over_limit test reliable by using a tmpdirMichael Adam2017-03-281-6/+6
| | | | | | | | Originally,f there were other files matching the glob of /tmp/tmp* then the test would fail. By using a tmpdir, we make sure that we know what files to expect. Signed-off-by: Michael Adam <obnox@samba.org>
* [plugins] add optional dir arg to create_file in plugin_testsMichael Adam2017-03-281-2/+2
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* [gnocchi] add_cmd_output block to be run only when ENVs setMartin Schuppert2017-03-281-14/+16
| | | | | | | | | | add_cmd_output now gets only called if the needed ENV variables are set to be able to connect to an OpenStack env. Resolves: #956. Signed-off-by: Martin Schuppert <mschuppe@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [reporting] workaround six mishandling of '\$' stringsBryn M. Reeves2017-03-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a problem with six's handling of strings that end with a backslash: https://bitbucket.org/gutworth/six/issues/60/sixu-mishandles-string-ending-in-backslash This leads to an ugly exception during reporting if any filename ends with this character: Traceback (most recent call last): File "/usr/sbin/sosreport", line 25, in <module> main(sys.argv[1:]) File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1632, in main sos.execute() File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1607, in execute self.plain_report() File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1358, in plain_report output = PlainTextReport(report).unicode() File "/usr/lib/python2.7/site-packages/sos/reporting.py", line 151, in unicode else six.u(i)), buf)) File "/usr/lib/python2.7/site-packages/sos/reporting.py", line 151, in <lambda> else six.u(i)), buf)) File "/usr/lib/python2.7/site-packages/six.py", line 647, in u return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape") UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 25: \ at end of string Avoid this problem by re-packing the buffer and adding a single ' ' character to the end of any string ending with '\'. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [collectd] add missing package listBryn M. Reeves2017-03-281-0/+2
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [makefiles] use rm -f when cleaning up *.pyc filesBryn M. Reeves2017-03-271-1/+1
| | | | | | | | | | | $ make rpm rm: remove write-protected regular file './sos/sosreport.pyc'? y rm: remove write-protected regular file './sos/policies/__pycache__/debian.cpython-35.pyc'? ^CMakefile:74: recipe for target 'clean' failed make: *** [clean] Interrupt Gets old very fast.. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [utilities] make sos_get_command_output() python3 compatibleBryn M. Reeves2017-03-271-1/+1
| | | | | | | | | The iteritems() member has been removed in python3. Since the environment loop in sos_get_command_output() is not expected to be run with very large inputs use .items() instead, which is compatible with both python2 and python3. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [jars] use bytestrings when operating on property filesBryn M. Reeves2017-03-271-2/+2
| | | | | | | For compatibility with python3, when using startswith() or split() with data read from a file, use bytes rather than a string. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [networking] collect nftables rules and filesRobb Manes2017-03-271-0/+12
| | | | | | | | | | | This patch adds to the networking plugin the command: $ nft list rulesets Which will provide all currently loaded nftables rulesets. In addition, it collects static nftables configuration. Signed-off-by: Robb Manes <rmanes@redhat.com>
* [gnochhi] fix plugin name to match fileBryn M. Reeves2017-03-271-1/+1
| | | | | | | | | | | | | | | Plugin names must match the filename they are found in: # sosreport -l | grep gnocchi openstack_gnocchi inactive Gnocchi - Metric as a service # sosreport -o openstack_gnocchi sosreport (version 3.3) a non-existing plugin (openstack_gnocchi) was specified in the command line Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [networking] collect socket stat from each namespaceMartin Schuppert2017-03-271-1/+2
| | | | | | | | | | | | added command to collect 'ss -lnp' within each namespace (edited to use -peaonmi for consistence with collection in the main namespace. -- bmr). Resolves: #966. Signed-off-by: Martin Schuppert <mschuppert@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [networking] Add ss socket outputPatrick Talbert2017-03-271-0/+1
| | | | | | | | | | | | | | | | | | | | Adds the following to the networking plugin: $ ss -peaonmi The ss tool provides much more detailed socket information than netstat and is almost guaranteed to be available while netstat not always so. ss provides some very useful extra TCP socket information such as memory allocations, the congestion window size, window scaling factor, segments sent/received, outstanding data, etc, etc. It also provides the socket address for every known socket type listed. The net-tools package is not part of the default package set for some minimal EL installs so it is not always available. ss is part of the more-modern iproute suite so is more likely to always be available. Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
* [xen] fix two typosJacob Wen2017-03-271-1/+1
| | | | | | Resolves: #914 Signed-off-by: Jacob Wen <jian.w.wen@oralce.com>
* [npm] get project's npm config list only if project_path is setPavel Moravec2017-03-271-3/+3
| | | | | | | | | _get_npm_output with working_directory=project_path must be called only if project_path is configured Resolves: #951 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [corosync] fix corosync.conf handling.Bryn M. Reeves2017-03-271-4/+12
| | | | | | | Don't try to open corosync.conf if it doesn't exist, and handle exceptions on open and IO if it does. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [zfs] Add plugin for Ubuntu/DebianEric Desrochers2017-03-271-0/+36
| | | | | | | Resolves: #934. Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [powerpc] capture files under /sys/fs/pstore/Bryn M. Reeves2017-03-271-1/+2
| | | | | | | This patch enables sosreport to capture files under /sys/fs/pstore/ . Signed-off-by: Mukesh Ojha <mukesh02 linux vnet ibm com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [powerpc] add diag_encl command output to sosreportBryn M. Reeves2017-03-271-1/+2
| | | | | | | | | This patch enables sosreport to collect "diag_encl -v" command output. Signed-off-by: Mukesh Ojha <mukesh02 linux vnet ibm com> Signed-off-by: Ankit Kumar <ankit linux vnet ibm com> Tested-by: Mukesh Ojha <mukesh02 linux vnet ibm com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [powerpc] remove lsvpd family commands from pluginBryn M. Reeves2017-03-271-5/+1
| | | | | | | | | | lsvpd family commands captures information, which can be extracted from /var/lib/lsvpd. So, avoid capturing duplicate information by skipping the execution of these command. Signed-off-by: Mukesh Ojha <mukesh02 linux vnet ibm com> Reviewed-by: Kamalesh Babulal <kamalesh linux vnet ibm com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [policies/debian] Remove glob in command that causes directories to be queried.Bryan Quigley2017-03-271-2/+2
| | | | | | | | | | | The change in how commands are parsed was introduced in commit 04d412816de2e4053f43956adf536272a2ddc19c. This caused our old dpkg parsing to not work. Whatever the reason for the \* in the command it doesn't appear to be needed now anyway so removing it. Resolves: #935 Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
* [openvswitch] capture kernel datapath flowsAaron Conole2017-03-271-0/+2
| | | | | | Resolves: #972. Signed-off-by: Aaron Conole <aconole@redhat.com>
* [openvswitch] additional methods for status fetchAaron Conole2017-03-271-0/+3
| | | | | | | | | | dpdk_nic_bind was renamed by the DPDK project to dpdk_devbind, which means we need to test for either. Additionally, driverctl is used in rhel systems to provide udev based persistent overrides, so capturing its output is helpful as well. Signed-off-by: Aaron Conole <aconole@redhat.com>
* [gnocchi] Missing "packages = .." causes plugins runs everytimePavel Moravec2017-03-271-0/+8
| | | | | | | | | | Specify packages plugin variable to run the plugin only on systems with gnocchi installed. Resolves: #977 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [collectd] Traceback when /etc/collectd.conf not readablePavel Moravec2017-03-271-5/+8
| | | | | | | | Catch IOError when opening /etc/collectd.conf and log it as a warning. Resolves: #968, #976. Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [dnf] Traceback when dnf history is emptyPavel Moravec2017-03-271-1/+1
| | | | | | | | Set transactions = -1 to skip for loop when dnf history is empty. Resolves: #969 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [numa] missing import to os.path.join commandPavel Moravec2017-03-271-0/+1
| | | | | | | | | "import os.path" missing. Resolves: #967 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [sosreport] use archive.add_file(FileObj) for HTML and text reportBryn M. Reeves2017-03-271-4/+4
| | | | | | | Pass the file object in which HTML and text reports have been generated to the archiving class. Since the files received are instances of TempFileUtil files, they will use fdopen and cannot return a valid file name.
* [sosreport] convert sos.log and ui.log to StreamHandlerBryn M. Reeves2017-03-271-6/+4
| | | | | | | | Use a StreamHandler for sos.log and ui.log so that data is sent directly to the log files, and to avoid the FileHandler creating a bogus '<fdopen>' directory entry. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [sosreport] open temporary files for reading and writingBryn M. Reeves2017-03-271-1/+1
| | | | | | | | | | Open files created by the TempFileUtil class for both reading and writing: this allows the log files that are managed by this class to be read back once they have been written. This will be used to convert logging handlers to StreamHandler. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [archive] accept an open File for add_file()Bryn M. Reeves2017-03-271-16/+32
| | | | | | | | | | | | | Allow subclasses of FileCacheArchive to accept either a path to a file to add, or an instance of an open File object, from whih data will be read. This will be used to covert logging FileHandler object to StreamHandler objects, avoiding creating bogus '<fdopen>' paths in the file system when the former are used with files that are created with os.fdopen(). Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [openstack_*] Collect undercloud debug informationMartin Schuppert2017-03-247-37/+136
| | | | | | | | | | | | | If auth information got sourced before sosreport run (OS_USERNAME, OS_PASSWORD, OS_TENANT_NAME) collect information from nova, neutron, keystone, glance, ironic and heat. Only undercloud specific heat information is collected in instack plugin. Closes: #955. Signed-off-by: Martin Schuppert <mschuppe@redhat.com>
* [policies] get package list without a timeoutPavel Moravec2017-03-241-2/+1
| | | | | | | | | Package list shall never timeout, otherwise pkgs gets empty, causing KeyError later on. Resolves: #942 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [openstack_manila] use wildcard for 'all_logs' collectionBryn M. Reeves2017-03-241-1/+1
| | | | | | | | | The current add_copy_spec_limit() implementation does not correctly support recursive directory addition: to make it more clear that we are collecting everything from the manila log directory use a '*' at the end of the path spec. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [openstack_manila] add new plugin at sos/pluginsPoornima Kshirsagar2017-03-241-0/+79
| | | | | | | | | | | Capture configuration and log files for OpenStack Manila project https://wiki.openstack.org/wiki/Manila Manila is File Share Service prototype, which provides coordinated access to shared or distributed file systems. This plugin captures manila related logs from openstack system. Signed-off-by: Poornima M. Kshirsagar pkshiras@redhat.com