A set of tools to gather troubleshooting information from a system
1efc87b2c3e71cccefe2bf5be8eca5651ea89cdf..8ad9c348d4c75aed85dd3bd48a29963ac87e6fe3
2019-01-29 CentOS Sources
debrand sos-3.6-13.el7_6
8ad9c3 diff | tree
2019-01-29 CentOS Sources
import sos-3.6-13.el7_6
e0829c diff | tree
3 files added
1 files deleted
1 files modified
455 ■■■■ changed files
SOURCES/sos-3.6-centos-branding.patch 105 ●●●●● patch | view | raw | blame | history
SOURCES/sos-bz1656732-ovirt_node-plugin.patch 68 ●●●●● patch | view | raw | blame | history
SOURCES/sos-bz1658570-docker-podman-containers.patch 186 ●●●●● patch | view | raw | blame | history
SOURCES/sos-bz1658571-postgresql-collect-full-dump.patch 76 ●●●●● patch | view | raw | blame | history
SPECS/sos.spec 20 ●●●● patch | view | raw | blame | history
SOURCES/sos-3.6-centos-branding.patch
File was deleted
SOURCES/sos-bz1656732-ovirt_node-plugin.patch
New file
@@ -0,0 +1,68 @@
From 0cddb4c820d39cae8bf6681c644fa353b0c20800 Mon Sep 17 00:00:00 2001
From: Nijin Ashok <nashok@redhat.com>
Date: Mon, 16 Jul 2018 14:42:43 +0530
Subject: [PATCH] [ovirt_node] New plugin for oVirt Node
oVirt Node is a small scaled down version used for hosting virtual
machines. The plugin collects node specific information like
upgrade log, the layer structure etc.
Resolves: #1381
Signed-off-by: Nijin Ashok nashok@redhat.com
Signed-off-by: Bryn M. Reeves bmr@redhat.com
---
 sos/plugins/ovirt_node.py | 41 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 sos/plugins/ovirt_node.py
diff --git a/sos/plugins/ovirt_node.py b/sos/plugins/ovirt_node.py
new file mode 100644
index 00000000..ccb5d3c6
--- /dev/null
+++ b/sos/plugins/ovirt_node.py
@@ -0,0 +1,41 @@
+# 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
+
+
+class OvirtNode(Plugin, RedHatPlugin):
+    """oVirt Node specific information"""
+
+    packages = (
+        'imgbased',
+        'ovirt-node-ng-nodectl',
+    )
+
+    plugin_name = 'ovirt_node'
+    profiles = ('virt',)
+
+    def setup(self):
+
+        # Add log files
+        self.add_copy_spec([
+            '/var/log/imgbased.log',
+            # Required for node versions < 4.2
+            '/tmp/imgbased.log',
+        ])
+
+        # Collect runtime info
+        self.add_cmd_output([
+            'imgbase layout',
+            'nodectl --machine-readable check',
+            'nodectl info',
+        ])
+
+
+# vim: expandtab tabstop=4 shiftwidth=4
--
2.17.2
SOURCES/sos-bz1658570-docker-podman-containers.patch
New file
@@ -0,0 +1,186 @@
From 77c72b415feccd828fd7bc13caebf9841afc40c2 Mon Sep 17 00:00:00 2001
From: "Bryn M. Reeves" <bmr@redhat.com>
Date: Mon, 3 Sep 2018 17:11:06 +0100
Subject: [PATCH] [docker] combine docker 'inspect' and 'logs' loops
We're iterating over all the containers: might as well only do it
one time.
Related: #1406, #1407
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
---
 sos/plugins/docker.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sos/plugins/docker.py b/sos/plugins/docker.py
index a44264a4..5b2acff5 100644
--- a/sos/plugins/docker.py
+++ b/sos/plugins/docker.py
@@ -80,9 +80,7 @@ class Docker(Plugin):
         if insp:
             for container in insp:
                 self.add_cmd_output("docker inspect %s" % container)
-
-            if self.get_option('logs'):
-                for container in insp:
+                if self.get_option('logs'):
                     self.add_cmd_output("docker logs -t %s" % container)
--
2.17.2
From e3cfb1428592390166237e715471bb62d9bd9db6 Mon Sep 17 00:00:00 2001
From: Daniel J Walsh <dwalsh@redhat.com>
Date: Wed, 29 Aug 2018 06:50:10 -0400
Subject: [PATCH] [podman] Add support for gathering information on podman
 containers
Resolves: #1407.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
---
 sos/plugins/podman.py | 79 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)
 create mode 100644 sos/plugins/podman.py
diff --git a/sos/plugins/podman.py b/sos/plugins/podman.py
new file mode 100644
index 00000000..c43246fc
--- /dev/null
+++ b/sos/plugins/podman.py
@@ -0,0 +1,79 @@
+# Copyright (C) 2018 Red Hat, Inc. Daniel Walsh <dwalsh@redhat.com>
+
+# 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, UbuntuPlugin
+
+
+class Podman(Plugin):
+
+    """Podman containers
+    """
+
+    plugin_name = 'podman'
+    profiles = ('container',)
+    packages = ('podman')
+
+    option_list = [
+        ("all", "enable capture for all containers, even containers "
+            "that have terminated", 'fast', False),
+        ("logs", "capture logs for running containers",
+            'fast', False),
+        ("size", "capture image sizes for podman ps", 'slow', False)
+    ]
+
+    def setup(self):
+        self.add_copy_spec([
+            "/etc/containers/registries.conf",
+            "/etc/containers/storage.conf",
+            "/etc/containers/mounts.conf",
+            "/etc/containers/policy.json",
+        ])
+
+        subcmds = [
+            'info',
+            'images',
+            'pod ps',
+            'pod ps -a',
+            'ps',
+            'ps -a',
+            'stats --no-stream',
+            'version',
+        ]
+
+        self.add_cmd_output(["podman %s" % s for s in subcmds])
+
+        # separately grab ps -s as this can take a *very* long time
+        if self.get_option('size'):
+            self.add_cmd_output('podman ps -as')
+
+        self.add_journal(units="podman")
+        self.add_cmd_output("ls -alhR /etc/cni")
+
+        ps_cmd = 'podman ps -q'
+        if self.get_option('all'):
+            ps_cmd = "%s -a" % ps_cmd
+
+        img_cmd = 'podman images -q'
+        insp = set()
+
+        for icmd in [ps_cmd, img_cmd]:
+            result = self.get_command_output(icmd)
+            if result['status'] == 0:
+                for con in result['output'].splitlines():
+                    insp.add(con)
+
+        if insp:
+            for container in insp:
+                self.add_cmd_output("podman inspect %s" % container)
+                if self.get_option('logs'):
+                    self.add_cmd_output("podman logs -t %s" % container)
+
+
+# vim: set et ts=4 sw=4 :
--
2.17.2
From 1401c7153dda9bd0558035ba0692cf05a93ca419 Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Tue, 6 Nov 2018 08:13:52 +0100
Subject: [PATCH] [podman] allow the plugin for RedHatPlugin and UbuntuPlugin
Until Podman inherits RedHatPlugin and/or UbuntuPlugin, the plugin
can not be executed on underlying distros.
Further, remove one redundant test as "for container in insp" will
work properly also for empty "insp".
Resolves: #1473
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
---
 sos/plugins/podman.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/sos/plugins/podman.py b/sos/plugins/podman.py
index c43246fc..72e22558 100644
--- a/sos/plugins/podman.py
+++ b/sos/plugins/podman.py
@@ -11,7 +11,7 @@
 from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin
-class Podman(Plugin):
+class Podman(Plugin, RedHatPlugin, UbuntuPlugin):
     """Podman containers
     """
@@ -69,11 +69,10 @@ class Podman(Plugin):
                 for con in result['output'].splitlines():
                     insp.add(con)
-        if insp:
-            for container in insp:
-                self.add_cmd_output("podman inspect %s" % container)
-                if self.get_option('logs'):
-                    self.add_cmd_output("podman logs -t %s" % container)
+        for container in insp:
+            self.add_cmd_output("podman inspect %s" % container)
+            if self.get_option('logs'):
+                self.add_cmd_output("podman logs -t %s" % container)
 # vim: set et ts=4 sw=4 :
--
2.17.2
SOURCES/sos-bz1658571-postgresql-collect-full-dump.patch
New file
@@ -0,0 +1,76 @@
From 47e6b3d92c8a13560b248e6f0e2ffb334b547d07 Mon Sep 17 00:00:00 2001
From: Yedidyah Bar David <didi@redhat.com>
Date: Tue, 4 Dec 2018 13:08:44 +0200
Subject: [PATCH] [Plugin] Obey sizelimit=0
If sizelimit is 0, do not limit. Only use the default if it's None.
Bug-Url: https://bugzilla.redhat.com/1654068
Signed-off-by: Yedidyah Bar David <didi@redhat.com>
---
 sos/plugins/__init__.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
index 7d2a8b2d..97f3cc59 100644
--- a/sos/plugins/__init__.py
+++ b/sos/plugins/__init__.py
@@ -569,7 +569,8 @@ class Plugin(object):
         a single file the file will be tailed to meet sizelimit. If the first
         file in a glob is too large it will be tailed to meet the sizelimit.
         """
-        sizelimit = sizelimit or self.get_option("log_size")
+        if sizelimit is None:
+            sizelimit = self.get_option("log_size")
         if self.get_option('all_logs'):
             sizelimit = None
@@ -703,7 +704,8 @@ class Plugin(object):
             cmds = [cmds]
         if len(cmds) > 1 and (suggest_filename or root_symlink):
             self._log_warn("ambiguous filename or symlink for command list")
-        sizelimit = sizelimit or self.get_option("log_size")
+        if sizelimit is None:
+            sizelimit = self.get_option("log_size")
         for cmd in cmds:
             self._add_cmd_output(cmd, suggest_filename=suggest_filename,
                                  root_symlink=root_symlink, timeout=timeout,
--
2.17.2
From 254d93499d64acaff5103e15c25649d418004737 Mon Sep 17 00:00:00 2001
From: Yedidyah Bar David <didi@redhat.com>
Date: Tue, 4 Dec 2018 13:10:32 +0200
Subject: [PATCH] [postgresql] Do not limit dump size
In principle, this might be risky - if a database is huge, we might not
want to collect all of it. But there is no sense in collecting only its
tail. If this turns out problematic, a future patch might check db size
and do not collect it at all if it's too large.
Bug-Url: https://bugzilla.redhat.com/1654068
Resolves: #1497
Signed-off-by: Yedidyah Bar David <didi@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
---
 sos/plugins/postgresql.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sos/plugins/postgresql.py b/sos/plugins/postgresql.py
index d47f7e8b..aef431f8 100644
--- a/sos/plugins/postgresql.py
+++ b/sos/plugins/postgresql.py
@@ -64,7 +64,7 @@ class PostgreSQL(Plugin):
                 if scl is not None:
                     cmd = self.convert_cmd_scl(scl, cmd)
                 self.add_cmd_output(cmd, suggest_filename=filename,
-                                    binary=True)
+                                    binary=True, sizelimit=0)
             else:  # no password in env or options
                 self.soslog.warning(
--
2.17.2
SPECS/sos.spec
@@ -2,7 +2,7 @@
Summary: A set of tools to gather troubleshooting information from a system
Name: sos
Version: 3.6
Release: 11%{?dist}
Release: 13%{?dist}
Group: Applications/System
Source0: https://github.com/sosreport/sos/archive/%{version}.tar.gz
License: GPLv2+
@@ -32,7 +32,10 @@
Patch12: sos-bz1623070-pipe-returncode.patch
Patch13: sos-bz1636093-openstack-relax-enabling-plugins.patch
Patch14: sos-bz1637632-kernel-dont-collect-tracing-instance.patch
Patch15: sos-3.6-centos-branding.patch
Patch15: sos-bz1656732-ovirt_node-plugin.patch
Patch16: sos-bz1658570-docker-podman-containers.patch
Patch17: sos-bz1658571-postgresql-collect-full-dump.patch
Patch18: sos-centos-branding.patch
%description
Sos is a set of tools that gathers information about system
@@ -58,6 +61,9 @@
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%build
make
@@ -81,9 +87,17 @@
%config(noreplace) %{_sysconfdir}/sos.conf
%changelog
* Mon Nov 12 2018 CentOS Sources <bugs@centos.org> - 3.6-11.el7.centos
* Tue Jan 29 2019 CentOS Sources <bugs@centos.org> - 3.6-13.el7.centos
- Roll in CentOS Branding
* Wed Dec 12 2018 Pavel Moravec <pmoravec@redhat.com> = 3.6-13
- [ovirt_node] New plugin for oVirt Node
  Resolves: bz1656732
- [podman] Add support for gathering information on podman
  Resolves: bz1658570
- [postgresql] Do not limit dump size
  Resolves: bz1658571
* Tue Oct 09 2018 Pavel Moravec <pmoravec@redhat.com> = 3.6-11
- [kernel] dont collect some tracing instance files
  Resolves: bz1637632