diff --git a/SOURCES/sos-3.7-centos-branding.patch b/SOURCES/sos-3.7-centos-branding.patch deleted file mode 100644 index 429db6b..0000000 --- a/SOURCES/sos-3.7-centos-branding.patch +++ /dev/null @@ -1,106 +0,0 @@ -diff -uNrp sos-3.6.orig/sos/policies/redhat.py sos-3.6/sos/policies/redhat.py ---- sos-3.6.orig/sos/policies/redhat.py 2018-11-04 17:44:59.513116585 +0000 -+++ sos-3.6/sos/policies/redhat.py 2018-11-04 17:53:28.333731059 +0000 -@@ -32,9 +32,9 @@ OS_RELEASE = "/etc/os-release" - - - class RedHatPolicy(LinuxPolicy): -- distro = "Red Hat" -- vendor = "Red Hat" -- vendor_url = "http://www.redhat.com/" -+ distro = "CentOS" -+ vendor = "CentOS" -+ vendor_url = "http://www,centos.org/" - _redhat_release = '/etc/redhat-release' - _tmp_dir = "/var/tmp" - _rpmq_cmd = 'rpm -qa --queryformat "%{NAME}|%{VERSION}|%{RELEASE}\\n"' -@@ -92,9 +92,9 @@ class RedHatPolicy(LinuxPolicy): - - @classmethod - def check(cls): -- """This method checks to see if we are running on Red Hat. It must be -+ """This method checks to see if we are running on CentOS. It must be - overriden by concrete subclasses to return True when running on a -- Fedora, RHEL or other Red Hat distribution or False otherwise.""" -+ Fedora, RHEL or CentOS distribution or False otherwise.""" - return False - - def check_usrmove(self, pkgs): -@@ -185,7 +185,7 @@ class RedHatPolicy(LinuxPolicy): - return self.host_name() - - --# Container environment variables on Red Hat systems. -+# Container environment variables on CentOS systems. - ENV_CONTAINER = 'container' - ENV_HOST_SYSROOT = 'HOST' - -@@ -230,9 +230,9 @@ rhel_presets = { - - - class RHELPolicy(RedHatPolicy): -- distro = RHEL_RELEASE_STR -- vendor = "Red Hat" -- vendor_url = "https://access.redhat.com/support/" -+ distro = "CentOS Linux" -+ vendor = "CentOS" -+ vendor_url = "https://wiki.centos.org/" - msg = _("""\ - This command will collect diagnostic and configuration \ - information from this %(distro)s system and installed \ -@@ -262,7 +262,7 @@ No changes will be made to system config - def check(cls): - """Test to see if the running host is a RHEL installation. - -- Checks for the presence of the "Red Hat Enterprise Linux" -+ Checks for the presence of the "CentOS Linux" - release string at the beginning of the NAME field in the - `/etc/os-release` file and returns ``True`` if it is - found, and ``False`` otherwise. -@@ -324,7 +324,7 @@ No changes will be made to system config - - ATOMIC = "atomic" - ATOMIC_RELEASE_STR = "Atomic" --ATOMIC_DESC = "Red Hat Enterprise Linux Atomic Host" -+ATOMIC_DESC = "CentOS Linux Atomic Host" - - atomic_presets = { - ATOMIC: PresetDefaults(name=ATOMIC, desc=ATOMIC_DESC, note=NOTE_TIME, -@@ -333,7 +333,7 @@ atomic_presets = { - - - class RedHatAtomicPolicy(RHELPolicy): -- distro = "Red Hat Atomic Host" -+ distro = "CentOS Atomic Host" - msg = _("""\ - This command will collect diagnostic and configuration \ - information from this %(distro)s system. -diff -uNrp sos-3.7.orig/sos/policies/redhat.py sos-3.7/sos/policies/redhat.py ---- sos-3.7.orig/sos/policies/redhat.py 2019-08-07 15:24:23.198233507 +0000 -+++ sos-3.7/sos/policies/redhat.py 2019-08-07 15:29:08.324131718 +0000 -@@ -198,7 +198,7 @@ _cb_plugs = ['abrt', 'block', 'boot', 'd - 'hardware', 'host', 'kernel', 'logs', 'lvm2', 'memory', 'rpm', - 'process', 'systemd', 'yum', 'xfs'] - --RHEL_RELEASE_STR = "Red Hat Enterprise Linux" -+RHEL_RELEASE_STR = "CentOS Linux" - - RHV = "rhv" - RHV_DESC = "Red Hat Virtualization" -@@ -207,13 +207,13 @@ RHEL = "rhel" - RHEL_DESC = RHEL_RELEASE_STR - - RHOSP = "rhosp" --RHOSP_DESC = "Red Hat OpenStack Platform" -+RHOSP_DESC = "RDO" - - RHOCP = "ocp" --RHOCP_DESC = "OpenShift Container Platform by Red Hat" -+RHOCP_DESC = "OpenShift" - - RH_SATELLITE = "satellite" --RH_SATELLITE_DESC = "Red Hat Satellite" -+RH_SATELLITE_DESC = "Satellite" - SAT_OPTS = SoSOptions(verify=True, plugopts=['apache.log=on']) - - CB = "cantboot" diff --git a/SOURCES/sos-bz1751576-gluster-deployment-cleanup-logs.patch b/SOURCES/sos-bz1751576-gluster-deployment-cleanup-logs.patch new file mode 100644 index 0000000..e0337b2 --- /dev/null +++ b/SOURCES/sos-bz1751576-gluster-deployment-cleanup-logs.patch @@ -0,0 +1,30 @@ +From 8203bdeb77ac0d3f32f1a88304b9a34de66ae7b6 Mon Sep 17 00:00:00 2001 +From: Gobinda Das +Date: Sat, 10 Aug 2019 13:36:36 +0530 +Subject: [PATCH] [ovirt_hosted_engine] Add gluster deployment and cleanup log + +Resolves: #1748 + +Signed-off-by: Gobinda Das +Signed-off-by: Pavel Moravec +--- + sos/plugins/ovirt_hosted_engine.py | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/sos/plugins/ovirt_hosted_engine.py b/sos/plugins/ovirt_hosted_engine.py +index 3d1bfe36c..fefc02947 100644 +--- a/sos/plugins/ovirt_hosted_engine.py ++++ b/sos/plugins/ovirt_hosted_engine.py +@@ -48,6 +48,12 @@ def setup(self): + '/var/log/ovirt-hosted-engine-ha/agent.log', + '/var/log/ovirt-hosted-engine-ha/broker.log', + ]) ++ ++ # Add gluster deployment and cleanup log ++ self.add_copy_spec([ ++ '/var/log/cockpit/ovirt-dashboard' ++ ]) ++ + # Add older ovirt-hosted-engine-ha log files only if requested + if self.get_option('all_logs'): + self.add_copy_spec(self.HA_LOG_GLOB) diff --git a/SOURCES/sos-bz1751577-vdsm-fix-shell-commands.patch b/SOURCES/sos-bz1751577-vdsm-fix-shell-commands.patch new file mode 100644 index 0000000..c0949fa --- /dev/null +++ b/SOURCES/sos-bz1751577-vdsm-fix-shell-commands.patch @@ -0,0 +1,36 @@ +From 0c83c8245ffab2ff3f568078651553f59ef475bb Mon Sep 17 00:00:00 2001 +From: Martin Perina +Date: Wed, 21 Aug 2019 11:17:44 +0200 +Subject: [PATCH] [vdsm]: Fix executing shell commands + +During review process of [1] it was suggested to replace '/bin/sh' with +just 'sh', but unfortunately this change caused an error to not include +information about VDSM mount points as described in [2]. This fix +restores previous state and add full path to shell executions. + +[1] https://github.com/sosreport/sos/pull/1205 +[2] https://bugzilla.redhat.com/1743304 + +Resolves: #1761 + +Signed-off-by: Martin Perina +Signed-off-by: Pavel Moravec +--- + sos/plugins/vdsm.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sos/plugins/vdsm.py b/sos/plugins/vdsm.py +index 35eec5093..c4e2af5f6 100644 +--- a/sos/plugins/vdsm.py ++++ b/sos/plugins/vdsm.py +@@ -93,8 +93,8 @@ def setup(self): + ]) + 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'" ++ "su vdsm -s /bin/sh -c 'tree -l /rhev/data-center'", ++ "su vdsm -s /bin/sh -c 'ls -lR /rhev/data-center'" + ]) + self.add_cmd_output([ + "lvm vgs -v -o +tags --config \'%s\'" % LVM_CONFIG, diff --git a/SOURCES/sos-bz1751578-ovn-plugins-containerized.patch b/SOURCES/sos-bz1751578-ovn-plugins-containerized.patch new file mode 100644 index 0000000..7b3dbfe --- /dev/null +++ b/SOURCES/sos-bz1751578-ovn-plugins-containerized.patch @@ -0,0 +1,264 @@ +From cc6374914a47eb3777c5b8306506df43522a31e0 Mon Sep 17 00:00:00 2001 +From: Daniel Alvarez +Date: Thu, 18 Jul 2019 14:08:27 +0200 +Subject: [PATCH 1/4] [ovn_central] add additional show commands + +This patch is adding 'show' commands for both OVN +NorthBound and SouthBound databases. + +Signed-off-by: Daniel Alvarez +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/ovn_central.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sos/plugins/ovn_central.py b/sos/plugins/ovn_central.py +index e0585687..2d252625 100644 +--- a/sos/plugins/ovn_central.py ++++ b/sos/plugins/ovn_central.py +@@ -57,6 +57,8 @@ class OVNCentral(Plugin): + + # Some user-friendly versions of DB output + cmds = [ ++ 'ovn-nbctl show', ++ 'ovn-sbctl show', + 'ovn-sbctl lflow-list', + 'ovn-nbctl get-ssl', + 'ovn-nbctl get-connection', +-- +2.21.0 + + +From 5fd4e850ad9a6636d0fb206954e8ab016584974d Mon Sep 17 00:00:00 2001 +From: Daniel Alvarez +Date: Wed, 11 Sep 2019 16:19:15 +0100 +Subject: [PATCH 2/4] [ovn_host] fix Open_vSwitch table name + +Signed-off-by: Daniel Alvarez +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/ovn_host.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sos/plugins/ovn_host.py b/sos/plugins/ovn_host.py +index 54251627..ba35d87e 100644 +--- a/sos/plugins/ovn_host.py ++++ b/sos/plugins/ovn_host.py +@@ -35,7 +35,7 @@ class OVNHost(Plugin): + self.add_cmd_output([ + 'ovs-ofctl -O OpenFlow13 dump-flows br-int', + 'ovs-vsctl list-br', +- 'ovs-vsctl list OpenVswitch', ++ 'ovs-vsctl list Open_vSwitch', + ]) + + self.add_journal(units="ovn-controller") +-- +2.21.0 + + +From 3c842046e9c4c5b371566347f51e5e242daf4f8d Mon Sep 17 00:00:00 2001 +From: Daniel Alvarez +Date: Tue, 23 Jul 2019 12:44:07 +0200 +Subject: [PATCH 3/4] [ovn_central] Add support to containerized setups + +This patch is adding support in ovn_central plugin to containerized +setups. + +Now it's detecting if the OVN central services are running in +container and execute the relevant commands inside it. The support +covers both podman and docker runtimes. + +Signed-off-by: Daniel Alvarez +--- + sos/plugins/ovn_central.py | 94 ++++++++++++++++++++++++++++---------- + 1 file changed, 69 insertions(+), 25 deletions(-) + +diff --git a/sos/plugins/ovn_central.py b/sos/plugins/ovn_central.py +index 2d252625..a9fcdf33 100644 +--- a/sos/plugins/ovn_central.py ++++ b/sos/plugins/ovn_central.py +@@ -19,30 +19,64 @@ class OVNCentral(Plugin): + """ + plugin_name = "ovn_central" + profiles = ('network', 'virt') +- +- def add_database_output(self, filename, cmds, ovn_cmd, skip=[]): ++ _container_runtime = None ++ _container_name = None ++ ++ def get_tables_from_schema(self, filename, skip=[]): ++ if self._container_name: ++ cmd = "%s exec %s cat %s" % ( ++ self._container_runtime, self._container_name, filename) ++ res = self.get_command_output(cmd) ++ if res['status'] != 0: ++ self._log_error("Could not retrieve DB schema file from " ++ "container %s" % self._container_name) ++ return ++ try: ++ db = json.loads(res['output']) ++ except Exception: ++ self._log_error("Cannot parse JSON file %s" % filename) ++ return ++ else: ++ try: ++ with open(filename, 'r') as f: ++ try: ++ db = json.load(f) ++ except Exception: ++ self._log_error( ++ "Cannot parse JSON file %s" % filename) ++ return ++ except IOError as ex: ++ self._log_error( ++ "Could not open DB schema file %s: %s" % (filename, ex)) ++ return + try: +- with open(filename, 'r') as f: +- try: +- db = json.load(f) +- except Exception: +- # If json can't be parsed, then exit early +- self._log_error("Cannot parse JSON file %s" % filename) +- return +- try: +- for table in six.iterkeys(db['tables']): +- if table not in skip: +- cmds.append('%s list %s' % (ovn_cmd, table)) +- except AttributeError: +- self._log_error("DB schema %s has no 'tables' key" % +- filename) +- return +- except IOError as ex: +- self._log_error("Could not open DB schema file %s: %s" % (filename, +- ex)) +- return ++ return [table for table in six.iterkeys( ++ db['tables']) if table not in skip] ++ except AttributeError: ++ self._log_error("DB schema %s has no 'tables' key" % filename) ++ ++ def add_database_output(self, tables, cmds, ovn_cmd): ++ for table in tables: ++ cmds.append('%s list %s' % (ovn_cmd, table)) ++ ++ def running_in_container(self): ++ for runtime in ["podman", "docker"]: ++ container_status = self.get_command_output(runtime + " ps") ++ if container_status['status'] == 0: ++ for line in container_status['output'].splitlines(): ++ if "ovn-dbs-bundle" in line: ++ self._container_name = line.split()[-1] ++ self._container_runtime = runtime ++ return True ++ return False ++ ++ def check_enabled(self): ++ return (self.running_in_container() or ++ super(OVNCentral, self).check_enabled()) + + def setup(self): ++ containerized = self.running_in_container() ++ + ovs_rundir = os.environ.get('OVS_RUNDIR') + for pidfile in ['ovnnb_db.pid', 'ovnsb_db.pid', 'ovn-northd.pid']: + self.add_copy_spec([ +@@ -68,10 +102,20 @@ class OVNCentral(Plugin): + + schema_dir = '/usr/share/openvswitch' + +- self.add_database_output(os.path.join(schema_dir, 'ovn-nb.ovsschema'), +- cmds, 'ovn-nbctl') +- self.add_database_output(os.path.join(schema_dir, 'ovn-sb.ovsschema'), +- cmds, 'ovn-sbctl', ['Logical_Flow']) ++ nb_tables = self.get_tables_from_schema(os.path.join( ++ schema_dir, 'ovn-nb.ovsschema')) ++ sb_tables = self.get_tables_from_schema(os.path.join( ++ schema_dir, 'ovn-sb.ovsschema'), ['Logical_Flow']) ++ ++ self.add_database_output(nb_tables, cmds, 'ovn-nbctl') ++ self.add_database_output(sb_tables, cmds, 'ovn-sbctl') ++ ++ # If OVN is containerized, we need to run the above commands inside ++ # the container. ++ if containerized: ++ cmds = ['%s exec %s %s' % (self._container_runtime, ++ self._container_name, ++ cmd) for cmd in cmds] + + self.add_cmd_output(cmds) + +-- +2.21.0 + + +From a895bf4096f1dbd71c9dbd4defb47783f4ef9840 Mon Sep 17 00:00:00 2001 +From: Daniel Alvarez +Date: Thu, 25 Jul 2019 11:42:16 +0200 +Subject: [PATCH 4/4] [ovn_host] Add support for containerized setups + +Prior to this patch, ovn_host was disabled on containerized +setups due to the fact that ovn-controller package is not +installed in the host. + +This patch fixes it by checking if the ovn-controller process +is running. + +Resolves: #1767 + +Signed-off-by: Daniel Alvarez +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/ovn_host.py | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +diff --git a/sos/plugins/ovn_host.py b/sos/plugins/ovn_host.py +index ba35d87e..5225f010 100644 +--- a/sos/plugins/ovn_host.py ++++ b/sos/plugins/ovn_host.py +@@ -12,6 +12,15 @@ import os + from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + + ++pidfile = 'ovn-controller.pid' ++pid_paths = [ ++ '/var/lib/openvswitch/ovn', ++ '/usr/local/var/run/openvswitch', ++ '/var/run/openvswitch', ++ '/run/openvswitch' ++] ++ ++ + class OVNHost(Plugin): + """ OVN Controller + """ +@@ -19,13 +28,6 @@ class OVNHost(Plugin): + profiles = ('network', 'virt') + + def setup(self): +- pidfile = 'ovn-controller.pid' +- pid_paths = [ +- '/var/lib/openvswitch/ovn', +- '/usr/local/var/run/openvswitch', +- '/var/run/openvswitch', +- '/run/openvswitch' +- ] + if os.environ.get('OVS_RUNDIR'): + pid_paths.append(os.environ.get('OVS_RUNDIR')) + self.add_copy_spec([os.path.join(pp, pidfile) for pp in pid_paths]) +@@ -40,6 +42,11 @@ class OVNHost(Plugin): + + self.add_journal(units="ovn-controller") + ++ def check_enabled(self): ++ return (any([os.path.isfile( ++ os.path.join(pp, pidfile)) for pp in pid_paths]) or ++ super(OVNHost, self).check_enabled()) ++ + + class RedHatOVNHost(OVNHost, RedHatPlugin): + +-- +2.21.0 + diff --git a/SPECS/sos.spec b/SPECS/sos.spec index 7fb5ab0..3d76a53 100644 --- a/SPECS/sos.spec +++ b/SPECS/sos.spec @@ -2,7 +2,7 @@ Summary: A set of tools to gather troubleshooting information from a system Name: sos Version: 3.7 -Release: 6%{?dist} +Release: 7%{?dist} Group: Applications/System Source0: https://github.com/sosreport/sos/archive/%{version}.tar.gz License: GPLv2+ @@ -29,7 +29,9 @@ Patch7: sos-bz1706060-vdsm-plugin.patch Patch8: sos-bz1711305-katello-qpid-certificate.patch Patch9: sos-bz1736424-timeouted-plugin-stop-further-collection.patch Patch10: sos-bz1736422-cmd-poll-performance.patch -Patch11: sos-3.7-centos-branding.patch +Patch11: sos-bz1751576-gluster-deployment-cleanup-logs.patch +Patch12: sos-bz1751577-vdsm-fix-shell-commands.patch +Patch13: sos-bz1751578-ovn-plugins-containerized.patch %description @@ -52,6 +54,8 @@ support technicians and developers. %patch9 -p1 %patch10 -p1 %patch11 -p1 +%patch12 -p1 +%patch13 -p1 %build make @@ -75,8 +79,13 @@ rm -rf ${RPM_BUILD_ROOT} %config(noreplace) %{_sysconfdir}/sos.conf %changelog -* Tue Sep 03 2019 CentOS Sources - 3.7-6.el7.centos -- Roll in CentOS Branding +* Thu Sep 12 2019 Pavel Moravec = 3.7-7 +- [ovirt_hosted_engine] Add gluster deployment and cleanup log + Resolves: bz1751576 +- [vdsm]: Fix executing shell commands + Resolves: bz1751577 +- [ovn_*] Add support to containerized setups, add commands + Resolves: bz1751578 * Thu Aug 01 2019 Pavel Moravec = 3.7-6 - [utilities] Fix high CPU usage and slow command collection