A set of tools to gather troubleshooting information from a system
cb372e99f240349af830c26729ee5de3ec3808f8..ccdb558c713bec9e7aa15cba7d7e18caf20806d6
2019-03-12 CentOS Sources
debrand sos-3.6-16.el7_6
ccdb55 diff | tree
2019-03-12 CentOS Sources
import sos-3.6-16.el7_6
03853b diff | tree
2 files added
1 files deleted
1 files modified
555 ■■■■ changed files
SOURCES/sos-3.6-centos-branding.patch 105 ●●●●● patch | view | raw | blame | history
SOURCES/sos-bz1669045-rhcos-policy-and-plugins.patch 302 ●●●●● patch | view | raw | blame | history
SOURCES/sos-bz1679238-crio-plugin.patch 126 ●●●●● patch | view | raw | blame | history
SPECS/sos.spec 22 ●●●● patch | view | raw | blame | history
SOURCES/sos-3.6-centos-branding.patch
File was deleted
SOURCES/sos-bz1669045-rhcos-policy-and-plugins.patch
New file
@@ -0,0 +1,302 @@
From fa06bc09c95c52565e29173535c7422608e9a29b Mon Sep 17 00:00:00 2001
From: Jake Hunsaker <jhunsake@redhat.com>
Date: Fri, 4 Jan 2019 13:35:34 -0500
Subject: [PATCH 1/4] [redhat] Add RHCOS policy
Adds a policy for Red Hat CoreOS.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
---
 sos/policies/redhat.py | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py
index e1e417f3..ea80704f 100644
--- a/sos/policies/redhat.py
+++ b/sos/policies/redhat.py
@@ -379,6 +379,48 @@ organization before being passed to any third party.
         return self.find_preset(ATOMIC)
+class RedHatCoreOSPolicy(RHELPolicy):
+    distro = "Red Hat CoreOS"
+    msg = _("""\
+This command will collect diagnostic and configuration \
+information from this %(distro)s system.
+
+An archive containing the collected information will be \
+generated in %(tmpdir)s and may be provided to a %(vendor)s \
+support representative.
+
+Any information provided to %(vendor)s will be treated in \
+accordance with the published support policies at:\n
+  %(vendor_url)s
+
+The generated archive may contain data considered sensitive \
+and its content should be reviewed by the originating \
+organization before being passed to any third party.
+%(vendor_text)s
+""")
+
+    def __init__(self, sysroot=None):
+        super(RedHatCoreOSPolicy, self).__init__(sysroot=sysroot)
+
+    @classmethod
+    def check(cls):
+        coreos = False
+        if ENV_HOST_SYSROOT not in os.environ:
+            return coreos
+        host_release = os.environ[ENV_HOST_SYSROOT] + cls._redhat_release
+        try:
+            for line in open(host_release, 'r').read().splitlines():
+                coreos |= 'Red Hat CoreOS' in line
+        except IOError:
+            pass
+        return coreos
+
+    def probe_preset(self):
+        # As of the creation of this policy, RHCOS is only available for
+        # RH OCP environments.
+        return self.find_preset(RHOCP)
+
+
 class FedoraPolicy(RedHatPolicy):
     distro = "Fedora"
--
2.17.2
From 3335f265213d7457d17139ee172bf21f1a66c229 Mon Sep 17 00:00:00 2001
From: "Bryn M. Reeves" <bmr@redhat.com>
Date: Fri, 18 Jan 2019 18:03:21 +0000
Subject: [PATCH 2/4] [policies] factor out Red Hat disclaimer text
Rather than repeating the same boilerplate disclaimer text in each
Red Hat policy class, define it once as a string, and then cat it
into each policy that requires a distinct preamble.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
---
 sos/policies/redhat.py | 48 ++++++++++++++----------------------------
 1 file changed, 16 insertions(+), 32 deletions(-)
diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py
index ea80704f..1d1606b6 100644
--- a/sos/policies/redhat.py
+++ b/sos/policies/redhat.py
@@ -229,6 +229,19 @@ rhel_presets = {
                                  note=NOTE_TIME, opts=_opts_verify),
 }
+# Legal disclaimer text for Red Hat products
+disclaimer_text = """
+Any information provided to %(vendor)s will be treated in \
+accordance with the published support policies at:\n
+  %(vendor_url)s
+
+The generated archive may contain data considered sensitive \
+and its content should be reviewed by the originating \
+organization before being passed to any third party.
+
+No changes will be made to system configuration.
+"""
+
 class RHELPolicy(RedHatPolicy):
     distro = RHEL_RELEASE_STR
@@ -242,18 +255,7 @@ applications.
 An archive containing the collected information will be \
 generated in %(tmpdir)s and may be provided to a %(vendor)s \
 support representative.
-
-Any information provided to %(vendor)s will be treated in \
-accordance with the published support policies at:\n
-  %(vendor_url)s
-
-The generated archive may contain data considered sensitive \
-and its content should be reviewed by the originating \
-organization before being passed to any third party.
-
-No changes will be made to system configuration.
-%(vendor_text)s
-""")
+""" + disclaimer_text + "%(vendor_text)s\n")
     def __init__(self, sysroot=None):
         super(RHELPolicy, self).__init__(sysroot=sysroot)
@@ -342,16 +344,7 @@ information from this %(distro)s system.
 An archive containing the collected information will be \
 generated in %(tmpdir)s and may be provided to a %(vendor)s \
 support representative.
-
-Any information provided to %(vendor)s will be treated in \
-accordance with the published support policies at:\n
-  %(vendor_url)s
-
-The generated archive may contain data considered sensitive \
-and its content should be reviewed by the originating \
-organization before being passed to any third party.
-%(vendor_text)s
-""")
+""" + disclaimer_text + "%(vendor_text)s\n")
     def __init__(self, sysroot=None):
         super(RedHatAtomicPolicy, self).__init__(sysroot=sysroot)
@@ -388,16 +381,7 @@ information from this %(distro)s system.
 An archive containing the collected information will be \
 generated in %(tmpdir)s and may be provided to a %(vendor)s \
 support representative.
-
-Any information provided to %(vendor)s will be treated in \
-accordance with the published support policies at:\n
-  %(vendor_url)s
-
-The generated archive may contain data considered sensitive \
-and its content should be reviewed by the originating \
-organization before being passed to any third party.
-%(vendor_text)s
-""")
+""" + disclaimer_text + "%(vendor_text)s\n")
     def __init__(self, sysroot=None):
         super(RedHatCoreOSPolicy, self).__init__(sysroot=sysroot)
--
2.17.2
From ff9b64ffb383b5b57cbba6de665d2b7794849be7 Mon Sep 17 00:00:00 2001
From: Jake Hunsaker <jhunsake@redhat.com>
Date: Fri, 4 Jan 2019 14:43:05 -0500
Subject: [PATCH 3/4] [rhcos] Add new plugin
Adds a new plugin for Red Hat CoreOS
Resolves: #1528
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
---
 sos/plugins/rhcos.py | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 sos/plugins/rhcos.py
diff --git a/sos/plugins/rhcos.py b/sos/plugins/rhcos.py
new file mode 100644
index 00000000..de9af9df
--- /dev/null
+++ b/sos/plugins/rhcos.py
@@ -0,0 +1,30 @@
+# Copyright (C) 2019 Red Hat, Inc., Jake Hunsaker <jhunsake@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
+
+
+class RHCoreOS(Plugin, RedHatPlugin):
+    """Red Hat CoreOS"""
+
+    plugin_name = 'rhcos'
+    packages = ('redhat-release-coreos', 'coreos-metadata')
+
+    def setup(self):
+        units = ['coreos-growpart', 'coreos-firstboot-complete']
+        for unit in units:
+            self.add_journal(unit)
+
+        self.add_cmd_output(
+            'coreos-metadata --cmdline --attributes /dev/stdout',
+            timeout=60
+        )
+
+# vim: set et ts=4 sw=4 :
--
2.17.2
From 12f12d490866587b254cdf182585529714b7e5bc Mon Sep 17 00:00:00 2001
From: Jake Hunsaker <jhunsake@redhat.com>
Date: Fri, 4 Jan 2019 15:02:55 -0500
Subject: [PATCH 4/4] [rpmostree] Add new plugin
Adds a new plugin for rpm-ostree, which is no longer limited to use in
Atomic Host.
Resolves: #1529
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
---
 sos/plugins/atomichost.py |  1 -
 sos/plugins/rpmostree.py  | 40 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 sos/plugins/rpmostree.py
diff --git a/sos/plugins/atomichost.py b/sos/plugins/atomichost.py
index deecba87..0c1f4026 100644
--- a/sos/plugins/atomichost.py
+++ b/sos/plugins/atomichost.py
@@ -25,7 +25,6 @@ class AtomicHost(Plugin, RedHatPlugin):
         return self.policy.in_container()
     def setup(self):
-        self.add_copy_spec("/etc/ostree/remotes.d")
         self.add_cmd_output("atomic host status")
         if self.get_option('info'):
diff --git a/sos/plugins/rpmostree.py b/sos/plugins/rpmostree.py
new file mode 100644
index 00000000..3c6872c2
--- /dev/null
+++ b/sos/plugins/rpmostree.py
@@ -0,0 +1,40 @@
+# Copyright (C) 2019 Red Hat, Inc., Jake Hunsaker <jhunsake@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
+
+
+class Rpmostree(Plugin, RedHatPlugin):
+    """rpm-ostree image/package system"""
+
+    plugin_name = 'rpmostree'
+    packages = ('rpm-ostree',)
+
+    def setup(self):
+        self.add_copy_spec('/etc/ostree/remotes.d/')
+
+        subcmds = [
+            'status',
+            'db list',
+            'db diff',
+            '--version'
+        ]
+
+        self.add_cmd_output(["rpm-ostree %s" % subcmd for subcmd in subcmds])
+
+        units = [
+            'rpm-ostreed',
+            'rpm-ostreed-automatic',
+            'rpm-ostree-bootstatus'
+        ]
+        for unit in units:
+            self.add_journal(unit)
+
+# vim: set et ts=4 sw=4 :
--
2.17.2
SOURCES/sos-bz1679238-crio-plugin.patch
New file
@@ -0,0 +1,126 @@
From 64d7cccf48aee9a07e2e4c5237034638cae30391 Mon Sep 17 00:00:00 2001
From: Daniel J Walsh <dwalsh@redhat.com>
Date: Wed, 29 Aug 2018 06:51:21 -0400
Subject: [PATCH] [crio] Add support for gathering information on cri-o
 containers
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
---
 sos/plugins/crio.py | 74 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)
 create mode 100644 sos/plugins/crio.py
diff --git a/sos/plugins/crio.py b/sos/plugins/crio.py
new file mode 100644
index 00000000..f3e9d842
--- /dev/null
+++ b/sos/plugins/crio.py
@@ -0,0 +1,74 @@
+# 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 CRIO(Plugin):
+
+    """CRI-O containers
+    """
+
+    plugin_name = 'crio'
+    profiles = ('container',)
+    packages = ('cri-o', "cri-tools")
+
+    option_list = [
+        ("all", "enable capture for all containers, even containers "
+            "that have terminated", 'fast', False),
+        ("logs", "capture logs for running containers",
+            'fast', False),
+    ]
+
+    def setup(self):
+        self.add_copy_spec([
+            "/etc/containers/registries.conf",
+            "/etc/containers/storage.conf",
+            "/etc/containers/mounts.conf",
+            "/etc/containers/policy.json",
+            "/etc/crio/crio.conf",
+            "/etc/crio/seccomp.json",
+            "/etc/systemd/system/cri-o.service",
+        ])
+
+        subcmds = [
+            'info',
+            'images',
+            'pods',
+            'ps',
+            'ps -a',
+            'stats',
+            'version',
+        ]
+
+        self.add_cmd_output(["crictl %s" % s for s in subcmds])
+        self.add_journal(units="cri-o")
+        self.add_cmd_output("ls -alhR /etc/cni")
+
+        ps_cmd = 'crictl ps --quiet'
+        if self.get_option('all'):
+            ps_cmd = "%s -a" % ps_cmd
+
+        img_cmd = 'cri-o images --quiet'
+        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("crictl inspect %s" % container)
+                if self.get_option('logs'):
+                    self.add_cmd_output("crictl logs -t %s" % container)
+
+# vim: set et ts=4 sw=4 :
--
2.17.2
From 36a82723dfc2734b18eede4b75708595345c9d7a Mon Sep 17 00:00:00 2001
From: Jake Hunsaker <jhunsake@redhat.com>
Date: Mon, 25 Feb 2019 11:50:50 -0500
Subject: [PATCH] [crio] Add tagging classes
Adds tagging classes so plugin will run on Red Hat and Ubuntu based
systems.
Resolves: #1578
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
---
 sos/plugins/crio.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sos/plugins/crio.py b/sos/plugins/crio.py
index f3e9d842..7afdf047 100644
--- a/sos/plugins/crio.py
+++ b/sos/plugins/crio.py
@@ -11,7 +11,7 @@
 from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin
-class CRIO(Plugin):
+class CRIO(Plugin, RedHatPlugin, UbuntuPlugin):
     """CRI-O containers
     """
--
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: 13%{?dist}
Release: 16%{?dist}
Group: Applications/System
Source0: https://github.com/sosreport/sos/archive/%{version}.tar.gz
License: GPLv2+
@@ -35,7 +35,9 @@
Patch15: sos-bz1656732-ovirt_node-plugin.patch
Patch16: sos-bz1658570-docker-podman-containers.patch
Patch17: sos-bz1658571-postgresql-collect-full-dump.patch
Patch18: sos-3.6-centos-branding.patch
Patch18: sos-bz1669045-rhcos-policy-and-plugins.patch
Patch19: sos-bz1679238-crio-plugin.patch
Patch20: sos-centos-branding.patch
%description
Sos is a set of tools that gathers information about system
@@ -64,6 +66,8 @@
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%build
make
@@ -87,9 +91,21 @@
%config(noreplace) %{_sysconfdir}/sos.conf
%changelog
* Tue Jan 29 2019 CentOS Sources <bugs@centos.org> - 3.6-13.el7.centos
* Tue Mar 12 2019 CentOS Sources <bugs@centos.org> - 3.6-16.el7.centos
- Roll in CentOS Branding
* Mon Feb 25 2019 Pavel Moravec <pmoravec@redhat.com> = 3.6-16
- [crio] Add tagging classes
  Resolves: bz1679238
* Wed Feb 20 2019 Pavel Moravec <pmoravec@redhat.com> = 3.6-15
- [crio] Add new plugin
  Resolves: bz1679238
* Thu Jan 24 2019 Pavel Moravec <pmoravec@redhat.com> = 3.6-14
- [rhcos,rpmostree] Add RHCOS policy and 2 plugins
  Resolves: bz1669045
* Wed Dec 12 2018 Pavel Moravec <pmoravec@redhat.com> = 3.6-13
- [ovirt_node] New plugin for oVirt Node
  Resolves: bz1656732