| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
stokachu++
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
The PermissionError exception is a python3 feature. Instead catch
the OSError (from which it inherits) to work on both py2 and py3
runtimes.
Related: #164
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The old profiling report was removed in favour of using external
profilers like cProfile. This is useful for overall profiling and
identifying code hotspots but is less helpful for drilling down
to the collection of individual items.
Since running programs is the dominant cost on typical hosts log
the time taken to run each call and tag it with the binary name.
This allows looking at the per-call and per-command cost across a
run of sosreport.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This plugin will collect all data relevant to PCP. Namely, it will
parse /etc/pcp.conf and then collect the following:
$PCP_SYSCONF_DIR
$PCP_VAR_DIR/config (we explicitely avoid $PCP_VAR_DIR/config/
{pmchart,pmlogconf,pmieconf,pmlogrewrite} as in 99% of the cases
they are just copies from the rpms.
$PCP_VAR_DIR/pmlogger/`hostname` (if it exists and if its size is
< 100MB by default. Unless option 'all_pcplogs' is specified)
$PCP_LOG_DIR/pmcd
$PCP_LOG_DIR/NOTICES*
$PCP_LOG_DIR/pmns
$PCP_LOG_DIR/*/*.log
$PCP_LOG_DIR/*/*.log*
$PCP_LOG_DIR/*/config*
Output of command 'pcp' to get the current status of the PCP
infrastructure.
The set of collected files has been discussed on the PCP mailing list:
http://mail.performancecopilot.org/pipermail/pcp/2014-April/004770.html
Signed-off-by: Michele Baldessari <michele at acksyn.org>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
The preferred_archive_name() policy method returns a class, not
a name. Rename it to 'get_preferred_archive()'.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
Fixes Issue #293.
Signed-off-by: Jamie Bainbridge <jamie.bainbridge@gmail.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Allows the plugin to collect data on standalone dwh and reports
installations.
Related: Issue #236, Issue #237
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
| |
Based on a patch for sos-2.0 by Sandro Bonazzola.
Fixes Issue #237.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
Add support for DWH to the oVirt plugin. Based on a patch for
sos-2.0 by Sandro Bonazzola. Fixes Issue #236.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Make sure that the oVirt plugin only runs if the ovirt-engine
package is present.
This will need to be expanded when the ovirt-engine-dwh and
ovirt-engine-reports support is merged (Issue #236 and Issue #237).
Signed-off-by: Brym M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This configuration file may contain passwords of the form:
And:
Add these to the existing 'passwd_files' processing added in
commit 3da5697.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
| |
These two configuration files may contain passwords of the form:
Add do_file_sub() calls to the plugin's postproc to remove these.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Remove both plaintext and pbkdf2 passwords from grub configuration
files and command output. Since grub does not mandate any
particular location for its authentication data we have to apply
these liberaly (to all grub*.cfg as well as to all /etc/grub.d
fragments and the output of grub2-mkconfig).
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The regex to match passwords in grub.conf needs to handle both
the --md5 and non-md5 cases and to apply the substitution only
to the secret part (password or password hash).
This needs to deal with the fact that python will return 'None'
for unmatched pattern groups leading to an exception in re.subn()
if not all referenced groups match for a given string (in contrast
to e.g. the perl approach of treating these groups as the empty
string).
Make this explicit by using an empty alternate in the possibly
unmatched '--md5' group:
r"(password\s*)(--md5\s*|\s*)(.*)",
r"\1\2********"
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
The grub.conf configuration file collected by the grub plugin may
contain a plaintext or md5 hashed bootloader password. Add a regex
substitution for all files matching '.*\/grub\.conf' and replace
the password with '*'s.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Plugin.do_path_regex_sub() method to apply regex substitutions
to paths matching a pattern documents that it accepts either a
compiled re object or a regular expression as a string:
'''Apply a regexp substituation to a set of files archived by
sos. The set of files to be substituted is generated by matching
collected file pathnames against pathexp which may be a regular
expression string or compiled re object. The portion of the file
to be replaced is specified via regexp and the replacement string
is passed in subst.'''
It lies. Attempting to pass a string for the 'pathexp' parameter
will result in:
Traceback (most recent call last):
File "/usr/sbin/sosreport", line 23, in <module>
main(sys.argv[1:])
File "/usr/lib/python2.6/site-packages/sos/sosreport.py", line 1229, in main
sos.execute()
AttributeError: 'str' object has no attribute 'match'
> /usr/lib/python2.6/site-packages/sos/plugins/__init__.py(219)do_path_regex_sub()
-> match = pathexp.match
Look to see if the object we are passed has a 'match()' method and
call re.compile on it if it does not.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
| |
Several plugins still tried to use the old tuple based return
values for self.call_ext_prog(). Convert them to use the
dictionary values instead.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
now that travis-ci supports python 3.4 we make the unittests pass on that
version a requirement.
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
|
|
|
|
|
|
|
|
| |
The lvm2 commands that sos issues are all read-only. Disable
locking when running the commands to avoid blocking if another
process or node is holding a lock.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
| |
The oVirt plugin tried to use the old tuple based return values
for self.call_ext_prog(). Convert it to use the dictionary values
instead.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
Add a plugin for oVirt based on the RHEV log collector plugin
with improvements and suggestions from Sandro Bonazzola.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Using a glob to pick up the boot logs means that we can pull in
unexpected content, e.g. /var/log/bootchart which may be large.
Just pick up the log file we're interested in. Fixes Issue #150.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
| |
The Windows port is unmaintained (and likely broken). Drop the
support for now. If there's interest in developing and maintaining
the port in the future this can be easily reverted.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Samuel Mendoza-Jonas <samjc.mj@gmail.com>
Minor fixups for missing comas and to apply to the current tree.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
| |
Always use an absolute path when calling TarFile.add() in
TarFileArchive._build_archive() and set arcname explicitly to the
(relative) path name to use in the archive.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was necessary to save and restore old_cwd and the umask around
calls to an external archive program. This isn't needed when
using native python implementations and causes problems in the
case that the current working directory no longer exists:
Creating compressed archive...
going to finalize
did finalize exception: [Errno 2] No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Traceback (most recent call last):
File "/sbin/sosreport", line 23, in <module>
main(sys.argv[1:])
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1233, in main
sos.execute()
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1222, in execute
return self.final_work()
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1159, in final_work
raise e
OSError: [Errno 2] No such file or directory
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the current working directory (as reported by getcwd()) does
not exist the package manager component of the policy may fail
to initialise:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Traceback (most recent call last):
File "/sbin/sosreport", line 23, in <module>
main(sys.argv[1:])
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 1228, in main
sos = SoSReport(args)
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 530, in __init__
self.policy = sos.policies.load()
File "/usr/lib/python2.7/site-packages/sos/policies/__init__.py", line 39, in load
cache['policy'] = policy()
File "/usr/lib/python2.7/site-packages/sos/policies/redhat.py", line 165, in __init__
super(FedoraPolicy, self).__init__()
File "/usr/lib/python2.7/site-packages/sos/policies/redhat.py", line 49, in __init__
if self.package_manager.all_pkgs()['filesystem']['version'][0] == '3':
File "/usr/lib/python2.7/site-packages/sos/policies/__init__.py", line 108, in all_pkgs
self.packages = self.get_pkg_list()
File "/usr/lib/python2.7/site-packages/sos/policies/__init__.py", line 95, in get_pkg_list
name, version = pkg.split("|")
ValueError: need more than 1 value to unpack
Fix this by ensuring that the string contains at least one pipe
character before splitting.
There are many reasons that the package manager could spit out
unexpected lines with the package list so this improves the
general robustness of this code.
Fixes RHBZ#1091683.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
The anchor at the end of the qemu XML password regex causes it to
not match in some cases. Remove it as it is unneccessary anyway.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>`
|
|
|
|
| |
Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>
|
|
|
|
| |
Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>
|
|
|
|
| |
Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>
|
|
|
|
|
| |
Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
|
|
|
|
|
| |
Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
|
|
|
|
|
| |
Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now collect all compressed and uncompressed sar?? and sa?? data
files. Given that tailing the text output is not very useful, we add an
option to not perform the tail when we have reached the limit.
NOTES:
* The 20 MB limit applies to each *set* of files being collected, so
there there is a 20 MB limit for the total number of sa??* files and
_separate_ 20 MB limit for sar??* files collected
* The 20 MB limit *does not apply* to the generated command output, so
if there is a 200+ MB sa?? data file present, that file won't be
collected, but the resulting 200+ MB sar?? and sar??.xml files will
still be collected in full
* The generated command output for missing sar files is only generated
from uncompressed binary data files
* The generated command output for the XML files is also only
generated from uncompressed binary data files
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Allow callers of add_copy_spec_limit() to disable collection of
the tail of a file when the limit is reached. This is not useful
for most binary data formats and even many text formats.
Based on a patch from Peter Portante <peter.portante@redhat.com>.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Peter Portante <peter.portante@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Loading the policy class accounts for most of the time sos spends
before outputing any UI text. Handle Ctrl-C during this period and
exit gracefully.
Fixes Issue #270.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
Write operations raise IOError instead of OSError and do not
expose a filename attribute.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Out-of-space and read-only file system errors while creating the
compressed archive should be treated as fatal and cause the run
to end.
Partial fix for Issue #266.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Out-of-space and read-only file system errors from plugins
should be treated as fatal and cause the run to end.
Partial fix for Issue #266.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Out-of-space and read-only file system errors while writing the
XML, plain-text, or HTML reports should be treated as fatal and
cause the run to end.
Partial fix for Issue #266.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Out-of-space and read-only file system errors from plugins
should be treated as fatal and cause the run to end.
Partial fix for Issue #266.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Allow the main SoSReport class to handle exceptions that occur
while calling a plugin's setup() and collect() methods.
Partial fix for Issue #266.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Out-of-space and read-only file system errors from plugins
should be treated as fatal and cause the run to end.
Partial fix for Issue #266.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
Check for ENOSPC and EROFS when setting up the archive directory
structure and exit with failure and an error message.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|