diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ef784c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/sos-3.7.tar.gz +SOURCES/sos-audit-0.3.tgz diff --git a/.sos.metadata b/.sos.metadata new file mode 100644 index 0000000..9abd7a0 --- /dev/null +++ b/.sos.metadata @@ -0,0 +1,2 @@ +38aa7609e7545eddf709db60fa1523432b268e13 SOURCES/sos-3.7.tar.gz +9d478b9f0085da9178af103078bbf2fd77b0175a SOURCES/sos-audit-0.3.tgz diff --git a/SOURCES/sos-bz1687954-buildah-index-out-of-range.patch b/SOURCES/sos-bz1687954-buildah-index-out-of-range.patch new file mode 100644 index 0000000..5491201 --- /dev/null +++ b/SOURCES/sos-bz1687954-buildah-index-out-of-range.patch @@ -0,0 +1,31 @@ +From 0100bd129e8fc809cc5b0258f6c0c7c64ad084ab Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Mon, 15 Apr 2019 11:50:55 +0200 +Subject: [PATCH] [buildah] parse container list properly even for scratch ones + +Scratch containers dont have id, therefore we shall get container name +as the latest string on each line instead of 5th. + +Resolves: #1647 + +Signed-off-by: Pavel Moravec +--- + sos/plugins/buildah.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sos/plugins/buildah.py b/sos/plugins/buildah.py +index c6c57553..fd8653eb 100644 +--- a/sos/plugins/buildah.py ++++ b/sos/plugins/buildah.py +@@ -47,7 +47,7 @@ class Buildah(Plugin, RedHatPlugin): + if containahs['is_wicked_pissah']: + for containah in containahs['auutput'].splitlines(): + # obligatory Tom Brady +- goat = containah.split()[4] ++ goat = containah.split()[-1] + self.add_cmd_output('buildah inspect -t container %s' % goat) + + pitchez = make_chowdah('buildah images -n') +-- +2.17.2 + diff --git a/SOURCES/sos-bz1695583-postgres-mysql-incorrect-defaults.patch b/SOURCES/sos-bz1695583-postgres-mysql-incorrect-defaults.patch new file mode 100644 index 0000000..a5d1036 --- /dev/null +++ b/SOURCES/sos-bz1695583-postgres-mysql-incorrect-defaults.patch @@ -0,0 +1,122 @@ +From c71b41547442d23daf5c3bf88450151d13903214 Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Thu, 4 Apr 2019 13:54:18 +0200 +Subject: [PATCH] [maas,mysql,npm,pacemaker,postgresql] fix plugopts data types + +With new enforcement of implicit data type for plugin options, the +plugopts must have proper data types of default values and plugins must work +with them accordingly (in tests or so). + +Resolves: #1635 + +Signed-off-by: Pavel Moravec +--- + sos/plugins/maas.py | 6 +++--- + sos/plugins/mysql.py | 2 +- + sos/plugins/npm.py | 4 ++-- + sos/plugins/pacemaker.py | 4 ++-- + sos/plugins/postgresql.py | 6 +++--- + 5 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/sos/plugins/maas.py b/sos/plugins/maas.py +index f8305406..ea038e86 100644 +--- a/sos/plugins/maas.py ++++ b/sos/plugins/maas.py +@@ -21,10 +21,10 @@ class Maas(Plugin, UbuntuPlugin): + + option_list = [ + ('profile-name', +- 'The name with which you will later refer to this remote', '', False), +- ('url', 'The URL of the remote API', '', False), ++ 'The name with which you will later refer to this remote', '', ''), ++ ('url', 'The URL of the remote API', '', ''), + ('credentials', +- 'The credentials, also known as the API key', '', False) ++ 'The credentials, also known as the API key', '', '') + ] + + def _has_login_options(self): +diff --git a/sos/plugins/mysql.py b/sos/plugins/mysql.py +index 49bc4168..411d90b8 100644 +--- a/sos/plugins/mysql.py ++++ b/sos/plugins/mysql.py +@@ -22,7 +22,7 @@ class Mysql(Plugin): + + option_list = [ + ("dbuser", "username for database dumps", "", "mysql"), +- ("dbpass", "password for database dumps" + pw_warn_text, "", False), ++ ("dbpass", "password for database dumps" + pw_warn_text, "", ""), + ("dbdump", "collect a database dump", "", False) + ] + +diff --git a/sos/plugins/npm.py b/sos/plugins/npm.py +index 0fc95801..ca00d0c0 100644 +--- a/sos/plugins/npm.py ++++ b/sos/plugins/npm.py +@@ -25,7 +25,7 @@ class Npm(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin, SuSEPlugin): + option_list = [("project_path", + 'List npm modules of a project specified by path', + 'fast', +- 0)] ++ '')] + + # in Fedora, Debian, Ubuntu and Suse the package is called npm + packages = ('npm',) +@@ -79,7 +79,7 @@ class Npm(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin, SuSEPlugin): + self.add_string_as_file(json.dumps(output), outfn) + + def setup(self): +- if self.get_option("project_path") != 0: ++ if self.get_option("project_path"): + project_path = os.path.abspath(os.path.expanduser( + self.get_option("project_path"))) + self._get_npm_output("npm ls --json", "npm_ls_project", +diff --git a/sos/plugins/pacemaker.py b/sos/plugins/pacemaker.py +index a1b64ea5..940389ee 100644 +--- a/sos/plugins/pacemaker.py ++++ b/sos/plugins/pacemaker.py +@@ -25,7 +25,7 @@ class Pacemaker(Plugin): + ) + + option_list = [ +- ("crm_from", "specify the start time for crm_report", "fast", False), ++ ("crm_from", "specify the start time for crm_report", "fast", ''), + ("crm_scrub", "enable password scrubbing for crm_report", "", True), + ] + +@@ -87,7 +87,7 @@ class Pacemaker(Plugin): + # time in order to collect data. + crm_from = (datetime.today() - + timedelta(hours=72)).strftime("%Y-%m-%d %H:%m:%S") +- if self.get_option("crm_from") is not False: ++ if self.get_option("crm_from"): + if re.match(r'\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}', + str(self.get_option("crm_from"))): + crm_from = self.get_option("crm_from") +diff --git a/sos/plugins/postgresql.py b/sos/plugins/postgresql.py +index 1698b62f..a04dca8f 100644 +--- a/sos/plugins/postgresql.py ++++ b/sos/plugins/postgresql.py +@@ -31,7 +31,7 @@ class PostgreSQL(Plugin): + option_list = [ + ('pghome', 'PostgreSQL server home directory.', '', '/var/lib/pgsql'), + ('username', 'username for pg_dump', '', 'postgres'), +- ('password', 'password for pg_dump' + password_warn_text, '', False), ++ ('password', 'password for pg_dump' + password_warn_text, '', ''), + ('dbname', 'database name to dump for pg_dump', '', ''), + ('dbhost', 'database hostname/IP (do not use unix socket)', '', ''), + ('dbport', 'database server port number', '', '5432') +@@ -43,8 +43,8 @@ class PostgreSQL(Plugin): + # We're only modifying this for ourself and our children so + # there is no need to save and restore environment variables if + # the user decided to pass the password on the command line. +- if self.get_option("password") is not False: +- os.environ["PGPASSWORD"] = str(self.get_option("password")) ++ if self.get_option("password"): ++ os.environ["PGPASSWORD"] = self.get_option("password") + + if self.get_option("dbhost"): + cmd = "pg_dump -U %s -h %s -p %s -w -F t %s" % ( +-- +2.17.2 + diff --git a/SOURCES/sos-bz1700780-vdsm-plugin.patch b/SOURCES/sos-bz1700780-vdsm-plugin.patch new file mode 100644 index 0000000..b1b9e13 --- /dev/null +++ b/SOURCES/sos-bz1700780-vdsm-plugin.patch @@ -0,0 +1,171 @@ +From 0618db904dadb05fde70c181a5940989ac127fe2 Mon Sep 17 00:00:00 2001 +From: Irit Goihman +Date: Thu, 1 Feb 2018 16:44:32 +0200 +Subject: [PATCH] [plugins] add vdsm plugin + +Add a plugin for vdsm + +Resolves: #1205 + +Signed-off-by: Irit Goihman +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/vdsm.py | 146 ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 146 insertions(+) + create mode 100644 sos/plugins/vdsm.py + +diff --git a/sos/plugins/vdsm.py b/sos/plugins/vdsm.py +new file mode 100644 +index 00000000..c648abbf +--- /dev/null ++++ b/sos/plugins/vdsm.py +@@ -0,0 +1,146 @@ ++# Copyright (C) 2018 Red Hat, Inc. ++ ++# This file is part of the sos project: https://github.com/sosreport/sos ++# ++# This copyrighted material is made available to anyone wishing to use, ++# modify, copy, or redistribute it subject to the terms and conditions of ++# version 2 of the GNU General Public License. ++# ++# See the LICENSE file in the source distribution for further information. ++ ++from sos.plugins import Plugin, RedHatPlugin ++ ++import glob ++import json ++import re ++ ++ ++# This configuration is based on vdsm.storage.lvm.LVM_CONF_TEMPLATE. ++# ++# locking_type is set to 0 in order to match lvm sos commands. With this ++# configuration we don't take any locks, so we will never block because ++# there is a stuck lvm command. ++# locking_type=0 ++# ++# use_lvmetad is set to 0 in order not to show cached, old lvm metadata. ++# use_lvmetad=0 ++# ++# preferred_names and filter config values are set to capture Vdsm devices. ++# preferred_names=[ '^/dev/mapper/' ] ++# filter=[ 'a|^/dev/mapper/.*|', 'r|.*|' ] ++LVM_CONFIG = """ ++global { ++ locking_type=0 ++ use_lvmetad=0 ++} ++devices { ++ preferred_names=["^/dev/mapper/"] ++ ignore_suspended_devices=1 ++ write_cache_state=0 ++ disable_after_error_count=3 ++ filter=["a|^/dev/mapper/.*|", "r|.*|"] ++} ++""" ++LVM_CONFIG = re.sub(r"\s+", " ", LVM_CONFIG).strip() ++ ++ ++class Vdsm(Plugin, RedHatPlugin): ++ """vdsm Plugin""" ++ ++ packages = ( ++ 'vdsm', ++ 'vdsm-client', ++ ) ++ ++ plugin_name = 'vdsm' ++ ++ def setup(self): ++ self.add_forbidden_path('/etc/pki/vdsm/keys/*') ++ self.add_forbidden_path('/etc/pki/vdsm/libvirt-spice/*-key.*') ++ self.add_forbidden_path('/etc/pki/libvirt/private/*') ++ ++ self.add_cmd_output('service vdsmd status') ++ ++ self.add_copy_spec([ ++ '/tmp/vds_installer*', ++ '/tmp/vds_bootstrap*', ++ '/etc/vdsm/*' ++ ]) ++ ++ limit = self.get_option('log_size') ++ ++ self.add_copy_spec('/var/log/vdsm/*', sizelimit=limit) ++ ++ self._add_vdsm_forbidden_paths() ++ self.add_copy_spec([ ++ '/var/run/vdsm/*', ++ '/usr/libexec/vdsm/hooks', ++ '/var/lib/vdsm' ++ ]) ++ ++ qemu_pids = self.get_process_pids('qemu-kvm') ++ if qemu_pids: ++ files = ["cmdline", "status", "mountstats"] ++ self.add_copy_spec([ ++ "/proc/%s/%s" % (pid, name) ++ for pid in qemu_pids ++ for name in files ++ ]) ++ self.add_cmd_output([ ++ "ls -ldZ /etc/vdsm", ++ "su vdsm -s sh -c 'tree -l /rhev/data-center'", ++ "su vdsm -s sh -c 'ls -lR /rhev/data-center'" ++ ]) ++ self.add_cmd_output([ ++ "lvm vgs -v -o +tags --config \'%s\'" % LVM_CONFIG, ++ "lvm lvs -v -o +tags --config \'%s\'" % LVM_CONFIG, ++ "lvm pvs -v -o +all --config \'%s\'" % LVM_CONFIG ++ ]) ++ ++ self.add_cmd_output([ ++ 'vdsm-client Host getCapabilities', ++ 'vdsm-client Host getStats', ++ 'vdsm-client Host getAllVmStats', ++ 'vdsm-client Host getVMFullList', ++ 'vdsm-client Host getDeviceList', ++ 'vdsm-client Host hostdevListByCaps', ++ 'vdsm-client Host getAllTasksInfo', ++ 'vdsm-client Host getAllTasksStatuses' ++ ]) ++ ++ try: ++ res = self.call_ext_prog( ++ 'vdsm-client Host getConnectedStoragePools' ++ ) ++ if res['status'] == 0: ++ pools = json.loads(res['output']) ++ for pool in pools: ++ self.add_cmd_output( ++ 'vdsm-client StoragePool getSpmStatus' ++ ' storagepoolID={}'.format(pool) ++ ) ++ except ValueError as e: ++ self._log_error( ++ 'vdsm-client Host getConnectedStoragePools: %s' % (e) ++ ) ++ ++ try: ++ res = self.call_ext_prog('vdsm-client Host getStorageDomains') ++ if res['status'] == 0: ++ sd_uuids = json.loads(res['output']) ++ dump_volume_chains_cmd = 'vdsm-tool dump-volume-chains %s' ++ self.add_cmd_output([ ++ dump_volume_chains_cmd % uuid for uuid in sd_uuids ++ ]) ++ except ValueError as e: ++ self._log_error( ++ 'vdsm-client Host getStorageDomains: %s' % (e) ++ ) ++ ++ def _add_vdsm_forbidden_paths(self): ++ """Add confidential sysprep vfds under /var/run/vdsm to ++ forbidden paths """ ++ ++ for file_path in glob.glob("/var/run/vdsm/*"): ++ if file_path.endswith(('.vfd', '/isoUploader', '/storage')): ++ self.add_forbidden_path(file_path) +-- +2.17.2 + diff --git a/SOURCES/sos-bz1702806-openstack_instack-ansible-log.patch b/SOURCES/sos-bz1702806-openstack_instack-ansible-log.patch new file mode 100644 index 0000000..80a0bbf --- /dev/null +++ b/SOURCES/sos-bz1702806-openstack_instack-ansible-log.patch @@ -0,0 +1,43 @@ +From 1b9c2032149488a2372d188a8ed3251e364f41cf Mon Sep 17 00:00:00 2001 +From: Emilien Macchi +Date: Wed, 24 Apr 2019 20:54:05 -0400 +Subject: [PATCH] [openstack_instack] add ansible.log + +Collect /var/lib/mistral/config-download-latest/ansible.log which is an +important log to be able to debug issues with Ansible playbooks. + +/var/lib/mistral/config-download-latest is a directory that exists +anyway on the undercloud and is the place where the ansible logs is +stored. + +Note: we don't want to collect the whole /var/lib/mistral because it +contains sensitive informations like username/passwords/endpoints. + +rhbz#1702806 +rhbz#1702802 + +Resolves: #1661 + +Signed-off-by: Emilien Macchi +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/openstack_instack.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/sos/plugins/openstack_instack.py b/sos/plugins/openstack_instack.py +index e3470f5a..15e6c384 100644 +--- a/sos/plugins/openstack_instack.py ++++ b/sos/plugins/openstack_instack.py +@@ -22,7 +22,8 @@ NON_CONTAINERIZED_DEPLOY = [ + CONTAINERIZED_DEPLOY = [ + '/var/log/heat-launcher/', + '/home/stack/install-undercloud.log', +- '/home/stack/undercloud-install-*.tar.bzip2' ++ '/home/stack/undercloud-install-*.tar.bzip2', ++ '/var/lib/mistral/config-download-latest/ansible.log' + ] + + +-- +2.17.2 + diff --git a/SOURCES/sos-bz1719884-pcp-pmlogger-no-limit.patch b/SOURCES/sos-bz1719884-pcp-pmlogger-no-limit.patch new file mode 100644 index 0000000..8c12a1b --- /dev/null +++ b/SOURCES/sos-bz1719884-pcp-pmlogger-no-limit.patch @@ -0,0 +1,30 @@ +From 380737d0bf4021434db4d5e479f0b8a2aece6ec9 Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Thu, 4 Apr 2019 10:43:24 +0200 +Subject: [PATCH] [pcp] collect pmlogger without a sizelimit + +sizelimit=None defaults to --log-size, use sizelimit=0 instead + +Resolves: #1632 + +Signed-off-by: Pavel Moravec +--- + sos/plugins/pcp.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sos/plugins/pcp.py b/sos/plugins/pcp.py +index da7158a6..da2a6611 100644 +--- a/sos/plugins/pcp.py ++++ b/sos/plugins/pcp.py +@@ -130,7 +130,7 @@ class Pcp(Plugin, RedHatPlugin, DebianPlugin): + pmlogger_ls = self.get_cmd_output_now("ls -t1 %s" % path) + if pmlogger_ls: + for line in open(pmlogger_ls).read().splitlines(): +- self.add_copy_spec(line, sizelimit=None) ++ self.add_copy_spec(line, sizelimit=0) + files_collected = files_collected + 1 + if self.countlimit and files_collected == self.countlimit: + break +-- +2.17.2 + diff --git a/SOURCES/sos-bz1719885-plugin-vs-command-timeouts.patch b/SOURCES/sos-bz1719885-plugin-vs-command-timeouts.patch new file mode 100644 index 0000000..00e896e --- /dev/null +++ b/SOURCES/sos-bz1719885-plugin-vs-command-timeouts.patch @@ -0,0 +1,45 @@ +From 7c8c45dad3481cfaae3d3af9c188218aa14a3a6a Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Tue, 9 Apr 2019 09:50:34 +0200 +Subject: [PATCH] [foreman,satellite] increase plugin default timeouts + +Those two plugins call commands with bigger timeouts than the default +plugin timeout is. That can unexpectedly kill the plugin execution when +the commands execution took longer than the plugin timeout (but within +cmd timeout). + +Resolves: #1642 + +Signed-off-by: Pavel Moravec +--- + sos/plugins/foreman.py | 1 + + sos/plugins/satellite.py | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/sos/plugins/foreman.py b/sos/plugins/foreman.py +index a1e937f3..8bcd26bd 100644 +--- a/sos/plugins/foreman.py ++++ b/sos/plugins/foreman.py +@@ -19,6 +19,7 @@ class Foreman(Plugin): + """ + + plugin_name = 'foreman' ++ plugin_timeout = 1800 + profiles = ('sysmgmt',) + packages = ('foreman', 'foreman-proxy') + option_list = [ +diff --git a/sos/plugins/satellite.py b/sos/plugins/satellite.py +index c50c2ec7..83733076 100644 +--- a/sos/plugins/satellite.py ++++ b/sos/plugins/satellite.py +@@ -14,6 +14,7 @@ class Satellite(Plugin, RedHatPlugin): + """ + + plugin_name = 'satellite' ++ plugin_timeout = 1200 + profiles = ('sysmgmt',) + verify_packages = ('spacewalk.*',) + satellite = False +-- +2.17.2 + diff --git a/SOURCES/sos-bz1719886-sos-conf-disabled-plugins-manpages.patch b/SOURCES/sos-bz1719886-sos-conf-disabled-plugins-manpages.patch new file mode 100644 index 0000000..bed3bde --- /dev/null +++ b/SOURCES/sos-bz1719886-sos-conf-disabled-plugins-manpages.patch @@ -0,0 +1,110 @@ +From 4cb21e2c16b55e7506a3cefd9148ba4bf49dbce1 Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Wed, 17 Apr 2019 13:17:24 +0200 +Subject: [PATCH] [sosreport] update sos.conf manpages by [general] section + description + +Since PR #1530, sosreport supports all command line options. Man pages +should document the enhancement. + +Resolves: #1652 + +Signed-off-by: Pavel Moravec +--- + man/en/sos.conf.5 | 38 ++++++++++++++++++++++++++++++++++---- + 1 file changed, 34 insertions(+), 4 deletions(-) + +diff --git a/man/en/sos.conf.5 b/man/en/sos.conf.5 +index b40a48e1..ad18d5f2 100644 +--- a/man/en/sos.conf.5 ++++ b/man/en/sos.conf.5 +@@ -6,19 +6,49 @@ sos.conf \- sosreport configuration + sosreport uses a configuration file at /etc/sos.conf. + .SH PARAMETERS + .sp +-There are two sections in the sosreport configuration file: +-plugins, and tunables. Options are set using 'ini'-style +-\fBname = value\fP pairs. ++There are three sections in the sosreport configuration file: ++general, plugins and tunables. Options are set using 'ini'-style ++\fBname = value\fP pairs. Disabling/enabling a boolean option ++is done the same way like on command line (e.g. process.lsof=off). + + Some options accept a comma separated list of values. + ++Using options that dont expect a value (like all-logs or no-report) ++will result in enabling those options, regardless of value set. ++ ++Sections are parsed in the ordering: ++.br ++- \fB[general]\fP ++.br ++- \fB[plugins]\fP (disable) ++.br ++- \fB[plugins]\fP (enable) ++.br ++- \fB[tunables]\fP ++ ++.TP ++\fB[general]\fP ++