| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Split listing&collecting instances and dbs from lengthy setup().
Break execution when "inst_out = self.get_cmd_output_now" returns None.
db_out is already checked this way.
Resolves: #614
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Use built-in set class instead of deprecated Set for sidsunique
Resolves: #608
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add a postproc method to ceilometer, cinder, glance, hoirzon and swift.
- Add missing keys to the remaining plugins.
- Modify the regular expression used by all plugins to ignore commented
out keys.
- Modify all plugins to use do_path_regex_sub() to apply regex to all
collected configuration files.
Resolves: #574
Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit f06efd6 removed passing stderr in _collect_cmd_output to
get_cmd_output_now. That prevents passing stderr=False in several
scenarios.
This fix adds the argument to be passed back.
Resolves: #600
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Juju can name files differently depending on the deployment
so we need iterate over all the files and capture at least some
of them all. At the same time the files can get quite big so we
need to be able to limit their size.
Now captures upstart/juju-db.log which is usually quite small.
Juju local is usually used for testing so we just capture
all-machines.log for that (format /var/log/juju-name-name/)
Lastly we capture the ls of all of the key directories just in
case we missed something.
Closes #593
Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The plotnetcfg tool [1] has recently been packaged for Fedora
and provides a useful method for visualising complex host
network toplogies. In the case of Openstack hosts this includes
Openvswitch devices, flows etc.
The resulting file can be used to generate a PDF visualising
this with the following command :
`cat plotnetcfg | dot -Tpdf > output.pdf`
[1] https://github.com/jbenc/plotnetcfg
Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This is useful information to be correlated with shutdown/reboot
events in /var/log/messages to identify graceful shutdowns/reboots
and lower false positives about system crashes.
Resolves #572.
Signed-off-by: Alexandru Juncu <alexj@linux.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
Resolves #580.
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
| |
When SYSROOT is not '/' relative symlinks need to be trimmed to
remove the extra leading '../' returned by
abspath('/sysroot/...').
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
| |
The abspath() call in _copy_symlink returns a host-relative path
(when SYSROOT is not '/'). Pass this directly to _do_copy_path()
without stripping the SYSROOT path component.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add journalctl output for the following kubernetes units:
kube-apiserver
kube-controller-manager
kube-scheduler
kube-proxy
Signed-off-by: Neependra Khare <nkhare@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
The docker package is named 'docker-io' in Fedora and 'docker'
in RHEL and other downstream products. Add the 'docker' name to
the package list in RedHatDocker to ensure the plugin runs.
Signed-off-by: Jeremy Eder <jeder@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
| |
Add a new policy for the Red Hat Atomic Host.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that policies have the infrastructure to detect that they
are running in a container and to use the HOST environment
variable if present enable automatic setting of self._tmp_dir in
appriate container environments.
This causes reports to be automatically written to $HOST/var/tmp
when $HOST is set while still allowing users to override the tmp
path manually by specificying --tmp-dir=PATH.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Neependra Khare <nkhare@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Neependra Khare <nkhare@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make sure the sysroot and chroot members of the SoSOptions object
are initialised to prevent exceptions when these are not set on
the command line:
sosreport
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 1490, in main
sos = SoSReport(args)
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 673, in __init__
self.policy = sos.policies.load(sysroot=self.opts.sysroot)
File "/usr/lib/python2.7/site-packages/sos/policies/__init__.py", line 40, in load
cache['policy'] = policy(sysroot=sysroot)
File "/usr/lib/python2.7/site-packages/sos/policies/redhat.py", line 192, in __init__
super(FedoraPolicy, self).__init__(sysroot=sysroot)
File "/usr/lib/python2.7/site-packages/sos/policies/redhat.py", line 58, in __init__
if self.package_manager.all_pkgs()['filesystem']['version'][0] == '3':
File "/usr/lib/python2.7/site-packages/sos/policies/__init__.py", line 116, in all_pkgs
self.packages = self.get_pkg_list()
File "/usr/lib/python2.7/site-packages/sos/policies/__init__.py", line 99, in get_pkg_list
pkg_list = shell_out(cmd, chroot=self.chroot).splitlines()
File "/usr/lib/python2.7/site-packages/sos/utilities.py", line 191, in shell_out
return sos_get_command_output(cmd, chroot=chroot, chdir=runat)['output']
File "/usr/lib/python2.7/site-packages/sos/utilities.py", line 156, in sos_get_command_output
raise e
OSError: [Errno 1] Operation not permitted: '/'
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Policies that don't auto-detect a container environment with a
host file system need to pass the value of --sysroot down to the
PackageManager class in order to obtain package details from the
chroot environment.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
Add a 10s timeout to firewalld-cmd execution to avoid long dbus
timeouts in docker containers.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
| |
If --sysroot is not given on the command line and
Policy.in_container() is True set sysroot automatically if
Policy.get_host_sysroot() is not '/'.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Check for the presence of container-specific environment variables
and set _host_sysroot if present:
container_uuid=UUID
HOST=/path
If both a container environment variable and HOST are present run
the PackageManager query command in a chroot.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Add methods to Policy to get the host root file system path and
to test if sos is running in a container and allow Policy classes
to pass a chroot path into the PackageManager constructor in order
to obtain package data from the chroot.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
Add a plugin for Kubernetes support.
Signed-off-by: Neependra Khare <nkhare@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A problem with systemd's management of the binfmt_misc automount
point in Atomic environments causes attempts to access this path to
fail with ELOOP:
>>> import os
>>> os.listdir("/host/proc/sys/fs/binfmt_misc/")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 2] No such file or directory: '/host/proc/sys/fs/binfmt_misc/'
For reasons that are not yet clear this causes the entire sos
process to immediately terminate.
For now avoid the problem by enclosing the problem os.listdir in
a try/except block that explicitly handles the one errno value
implicated here.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
| |
The logs plugin searches syslog configuration files. When using
--sysroot the plugin needs to use join_sysroot() to open the
correct path.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
The libvirt plugin tests for the presence of files. Use
join_sysroot() to ensure the correct path is tested.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
| |
To dump metadata dmraid needs to chdir to the temporary archive
directory. Don't attempt to chroot into sysroot if the temporary
directory is not a subdirectory of it.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
Don't attempt to run crm_report in the chroot if tmp is not a
subdirectory of sysroot.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Add a method that plugins can test to determine whether the
archive's temporary directory is inside sysroot. This is always
true when sysroot is '/'. When sysroot is a subdirectory of root
the temporary directory may be inaccessible from the chroot
namespace. Plugins can test this method to determine where to
write output.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Expose sos_get_command_output()'s chroot support to plugins via
add_cmd_output(), get_command_output(), call_ext_prog() and
related Plugin methods.
'chroot' is a boolean indicating whether the command should run
in the chroot (True) or in the host namespace (False).
Has no effect when Plugin.use_sysroot() is False.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
_copy_symlink() needs to strip_sysroot(), not join_sysroot(), on
a link target before handing it to _do_copy_path().
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
| |
When --chroot=always is given chroot all commands to SYSROOT.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a --chroot option to sosreport to control command chrooting.
The option takes one of three values:
* auto - Allow callers of the API to control chroot behaviour
* always - Always chroot external commands to --sysroot
* never - Never chroot external commands
This is a fairly low-level option and may not be exposed to the
user in a final release; for now it will allow tests in container
environments to control the chrooting behaviour used for a run.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
Allow callers of sos_get_command_output() to specify a path to
chroot into before executing command.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Prefix copyspecs with self.sysroot when using an alternate root
path. Prefixes are applied before expanding copyspecs and the
prefixed paths are stored as the 'srcpath' attribute in the
archive. Destination paths in the report archive do not include
the prefix.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Although plugins should generally be unaware that they are being
run with an alternate sysroot the generic plugin IO code must
peform the appropriate path prefixing when sysroot is not '/'.
Propagate sysroot to plugin classes via the commons dictionary.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a --sysroot=SYSROOT option to specify that the root file system to
be inspected is mounted at SYSROOT.
This allows basic support for container environments where sos is
running in a container and inspecting the containing host and its
environment ('superspection').
For this to work currently the following conditions must be met:
- sos is sufficiently privileged to read and search relevant file
system paths within SYSROOT
- sos must share the PID and network namespace of the target host
- binaries called by sos must be present and executable in the
SYSROOT inherited by sos. If PATH includes paths inside SYSROOT
appropriate values must be set for LD_LIBRARY_PATH to allow
shared executables to be linked.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following passwords and secrets are now obscured :
- rabbit_password
- qpid_password
- nova_admin_password
- xenapi_connection_password
- password
- connection
- admin_password
- metadata_proxy_shared_secret
- qpid_password
- eapi_password
- crd_password
- primary_l3_host_password
- serverauth
- ucsm_password
- ha_vrrp_auth_password
- ssl_key_password
- vcenter_password
- edge_appliance_password
- tenant_admin_password
- apic_password
Fixes #594
Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
|
|
|
|
|
|
| |
Partially resolves #570
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
|