1
0
forked from rpms/sos

Compare commits

..

No commits in common. "c8-beta" and "c8" have entirely different histories.
c8-beta ... c8

9 changed files with 316 additions and 139 deletions

4
.gitignore vendored
View File

@ -1,2 +1,2 @@
SOURCES/sos-4.6.0.tar.gz
SOURCES/sos-audit-0.3.tgz
SOURCES/sos-4.9.1.tar.gz
SOURCES/sos-audit-0.3-1.tgz

View File

@ -1,2 +1,2 @@
90d8b664a4e0593d60357342bb5f73af9908e29d SOURCES/sos-4.6.0.tar.gz
9d478b9f0085da9178af103078bbf2fd77b0175a SOURCES/sos-audit-0.3.tgz
9c7e8309a950a99ccd4f02268b7b842374f7da16 SOURCES/sos-4.9.1.tar.gz
00752b68ec5e1141192a9dab7d44377b8d637bf7 SOURCES/sos-audit-0.3-1.tgz

View File

@ -1,126 +0,0 @@
From 43714aa5aeb3dcb0dec17dd026ca5c394cc06afd Mon Sep 17 00:00:00 2001
From: Periyasamy Palanisamy <pepalani@redhat.com>
Date: Fri, 11 Aug 2023 14:30:42 +0200
Subject: [PATCH] Collect additional ovnkube node logs
With Interconnect support in latest OVN-Kubernetes, ovnkube-nodes
logs grew large. This commit adds the ability to collect those
additional logs.
Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
---
sos/report/plugins/openshift_ovn.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sos/report/plugins/openshift_ovn.py b/sos/report/plugins/openshift_ovn.py
index d81fc97aa..2d804e9ae 100644
--- a/sos/report/plugins/openshift_ovn.py
+++ b/sos/report/plugins/openshift_ovn.py
@@ -30,7 +30,8 @@ def setup(self):
# Collect ovn interconnect specific files if exists.
self.add_copy_spec([
"/var/lib/ovn-ic/etc/ovnnb_db.db",
- "/var/lib/ovn-ic/etc/ovnsb_db.db"
+ "/var/lib/ovn-ic/etc/ovnsb_db.db",
+ "/var/lib/ovn-ic/etc/libovsdb*log*"
])
# The ovn cluster/status is not valid anymore for interconnect setup.
From e11a594f942f9ae98aeb644c573293b391050657 Mon Sep 17 00:00:00 2001
From: Periyasamy Palanisamy <pepalani@redhat.com>
Date: Tue, 15 Aug 2023 11:47:20 +0200
Subject: [PATCH] Collect ovn logs as much as possible
The sosreport limits to collect logs at maximum of 25 MB in a given
collection passed into add_copy_spec method. so this may lead into
logs wouldn't have fully collected when user collected sos report
without --all-logs option.
Hence this commit ensures logs and dbs collected as much as possible
when --all-logs option is not specified.
Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
---
sos/report/plugins/openshift_ovn.py | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/sos/report/plugins/openshift_ovn.py b/sos/report/plugins/openshift_ovn.py
index 2d804e9ae..347b15eea 100644
--- a/sos/report/plugins/openshift_ovn.py
+++ b/sos/report/plugins/openshift_ovn.py
@@ -20,19 +20,28 @@ class OpenshiftOVN(Plugin, RedHatPlugin):
profiles = ('openshift',)
def setup(self):
+ all_logs = self.get_option("all_logs")
+
self.add_copy_spec([
"/var/lib/ovn/etc/ovnnb_db.db",
"/var/lib/ovn/etc/ovnsb_db.db",
- "/var/lib/openvswitch/etc/keys",
- "/var/log/openvswitch/libreswan.log",
- "/var/log/openvswitch/ovs-monitor-ipsec.log"
- ])
- # Collect ovn interconnect specific files if exists.
+ "/var/lib/openvswitch/etc/keys"
+ ], sizelimit=300)
+
+ # Collect ovn interconnect specific db files if exists.
self.add_copy_spec([
"/var/lib/ovn-ic/etc/ovnnb_db.db",
- "/var/lib/ovn-ic/etc/ovnsb_db.db",
- "/var/lib/ovn-ic/etc/libovsdb*log*"
- ])
+ "/var/lib/ovn-ic/etc/ovnsb_db.db"
+ ], sizelimit=300)
+
+ # Collect libovsdb logs in case of ovn interconnect setup.
+ if not all_logs:
+ self.add_copy_spec([
+ "/var/lib/ovn-ic/etc/libovsdb.log",
+ "/var/lib/ovn-ic/etc/libovsdb*log.gz"
+ ], sizelimit=100)
+ else:
+ self.add_copy_spec("/var/lib/ovn-ic/etc/libovsdb*log*")
# The ovn cluster/status is not valid anymore for interconnect setup.
self.add_cmd_output([
From 7cd6f61fd15ae7fc93d62cca927204351cdc1322 Mon Sep 17 00:00:00 2001
From: Periyasamy Palanisamy <pepalani@redhat.com>
Date: Wed, 30 Aug 2023 09:56:40 +0200
Subject: [PATCH] Collect logs from ovnkube-controller container
This enables ovn sos report plugin to collect logs ovnkube-controller
container because ovn-kubernetes now provides option to run both
ovnkube-node and ovnkube-controller in same container with this
PR https://github.com/ovn-org/ovn-kubernetes/pull/3807.
Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
---
sos/report/plugins/openshift_ovn.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sos/report/plugins/openshift_ovn.py b/sos/report/plugins/openshift_ovn.py
index 347b15eea..cb48057d3 100644
--- a/sos/report/plugins/openshift_ovn.py
+++ b/sos/report/plugins/openshift_ovn.py
@@ -16,7 +16,8 @@ class OpenshiftOVN(Plugin, RedHatPlugin):
"""
short_desc = 'Openshift OVN'
plugin_name = "openshift_ovn"
- containers = ('ovnkube-master', 'ovnkube-node', 'ovn-ipsec')
+ containers = ('ovnkube-master', 'ovnkube-node', 'ovn-ipsec',
+ 'ovnkube-controller')
profiles = ('openshift',)
def setup(self):
@@ -54,6 +55,10 @@ def setup(self):
'ovs-appctl -t /var/run/ovn/ovn-controller.*.ctl ' +
'ct-zone-list'],
container='ovnkube-node')
+ self.add_cmd_output([
+ 'ovs-appctl -t /var/run/ovn/ovn-controller.*.ctl ' +
+ 'ct-zone-list'],
+ container='ovnkube-controller')
# Collect ovs ct-zone-list directly on host for interconnect setup.
self.add_cmd_output([
'ovs-appctl -t /var/run/ovn-ic/ovn-controller.*.ctl ' +

View File

@ -0,0 +1,37 @@
From 1d449044caf2224da5e55d0de51459137feb0807 Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Sun, 25 May 2025 11:46:34 +0200
Subject: [PATCH] [cleaner] Use "hostname -f" in HostnamePrepper
HostnamePrepper should always be fed by FQDN to ensure domain names are
recognized properly.
This is important esp. when:
- /etc/hosts is empty
- "hostname" contains shortname only
- "hostname -f" contains FQDN
Resolves: #4022
Closes: #4026
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
---
sos/cleaner/preppers/hostname.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sos/cleaner/preppers/hostname.py b/sos/cleaner/preppers/hostname.py
index 0812597e..b20f5679 100644
--- a/sos/cleaner/preppers/hostname.py
+++ b/sos/cleaner/preppers/hostname.py
@@ -29,7 +29,7 @@ class HostnamePrepper(SoSPrepper):
items = []
_file = 'hostname'
if archive.is_sos:
- _file = 'sos_commands/host/hostname'
+ _file = 'sos_commands/host/hostname_-f'
elif archive.is_insights:
_file = 'data/insights_commands/hostname_-f'
--
2.49.0

View File

@ -0,0 +1,30 @@
From c41fca3daed8b515c4022ab02232acab8b1ec4c4 Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Tue, 20 May 2025 13:18:26 +0200
Subject: [PATCH] [dnf] Scrub passwords in repository URIs
Closes: #4018
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
---
sos/report/plugins/dnf.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/sos/report/plugins/dnf.py b/sos/report/plugins/dnf.py
index 4a1e52b9..69224955 100644
--- a/sos/report/plugins/dnf.py
+++ b/sos/report/plugins/dnf.py
@@ -150,4 +150,10 @@ class DNFPlugin(Plugin, RedHatPlugin):
#
self.do_file_sub("/etc/dnf/dnf.conf", regexp, repl)
+ # Scrub credentials in http URIs
+ self.do_paths_http_sub([
+ '/etc/yum.repos.d/*',
+ '/var/log/dnf.*',
+ ])
+
# vim: set et ts=4 sw=4 :
--
2.49.0

View File

@ -0,0 +1,111 @@
From 369e65acafa70a6d7a9751802395bddaaeafd141 Mon Sep 17 00:00:00 2001
From: Jose Castillo <jcastillo@redhat.com>
Date: Wed, 21 May 2025 10:10:41 +0100
Subject: [PATCH] [policy] Re-add logic to request case-id if not present
This commit re-adds the logic to ask for case-id if
the user hasn't specified it in the command line
explicitly.
Related: RHEL-92071
Signed-off-by: Jose Castillo <jcastillo@redhat.com>
---
sos/policies/distros/__init__.py | 18 ++++++++++++++++--
sos/upload/__init__.py | 3 +++
sos/upload/targets/redhat.py | 22 ++--------------------
3 files changed, 21 insertions(+), 22 deletions(-)
diff --git a/sos/policies/distros/__init__.py b/sos/policies/distros/__init__.py
index 06327a6b..7004fdbd 100644
--- a/sos/policies/distros/__init__.py
+++ b/sos/policies/distros/__init__.py
@@ -13,6 +13,7 @@
import os
import re
+from sos import _sos as _
from sos.policies import Policy
from sos.policies.init_systems import InitSystem
from sos.policies.init_systems.systemd import SystemdInit
@@ -300,8 +301,21 @@ class LinuxPolicy(Policy):
if cmdline_opts.low_priority:
self._configure_low_priority()
- if cmdline_opts.case_id:
- self.case_id = cmdline_opts.case_id
+ # set or query for case id
+ self.case_id = self.prompt_for_case_id(cmdline_opts)
+
+ def prompt_for_case_id(self, cmdline_opts):
+ if not cmdline_opts.batch and not \
+ cmdline_opts.quiet:
+ if not cmdline_opts.case_id:
+ cmdline_opts.case_id = input(
+ _("Optionally, please enter the case id that you are "
+ "generating this report for: ")
+ )
+ self.case_id = cmdline_opts.case_id if \
+ cmdline_opts.case_id else ""
+
+ return self.case_id
def _configure_low_priority(self):
"""Used to constrain sos to a 'low priority' execution, potentially
diff --git a/sos/upload/__init__.py b/sos/upload/__init__.py
index 97872f69..7be33f65 100644
--- a/sos/upload/__init__.py
+++ b/sos/upload/__init__.py
@@ -282,6 +282,9 @@ this utility.
if self.from_cmdline:
self.intro()
self.archive = self.opts.upload_file
+ self.caseid = self.policy.prompt_for_case_id(
+ cmdline_opts=self.opts
+ )
cmdline_target = self.opts.upload_target
if cmdline_target and cmdline_target != 'local':
self.upload_target = self.upload_targets[cmdline_target]
diff --git a/sos/upload/targets/redhat.py b/sos/upload/targets/redhat.py
index b3e8e3c5..d5262af0 100644
--- a/sos/upload/targets/redhat.py
+++ b/sos/upload/targets/redhat.py
@@ -52,25 +52,6 @@ class RHELUploadTarget(UploadTarget):
self.upload_directory = self.commons['cmdlineopts'].upload_directory
- def prompt_for_case_id(self):
- caseid = self.commons['cmdlineopts'].case_id if \
- self.commons['cmdlineopts'].case_id else ""
-
- # set or query for case id
- if not self.commons['cmdlineopts'].batch and not \
- self.commons['cmdlineopts'].quiet:
- if caseid:
- self.commons['cmdlineopts'].case_id = caseid
- else:
- self.commons['cmdlineopts'].case_id = input(
- _("Optionally, please enter the case id that you are "
- "generating this report for: ")
- )
- if self.commons['cmdlineopts'].case_id:
- self.case_id = self.commons['cmdlineopts'].case_id
-
- return self.case_id
-
def prompt_for_upload_user(self):
if self.commons['cmdlineopts'].upload_user:
self.ui_log.info(
@@ -101,7 +82,8 @@ class RHELUploadTarget(UploadTarget):
if self.commons['cmdlineopts'].upload_protocol == 'sftp':
return self.RH_SFTP_HOST
if not self.commons['cmdlineopts'].case_id and not\
- self.prompt_for_case_id():
+ self.commons['policy'].prompt_for_case_id(
+ self.commons['cmdlineopts']):
return self.RH_SFTP_HOST
except Exception as e:
--
2.49.0

View File

@ -0,0 +1,25 @@
--- a/sos/report/plugins/coredump.py
+++ b/sos/report/plugins/coredump.py
@@ -72,8 +72,8 @@
cdump = line.split()
pid = cdump[4]
exe = cdump[-2]
- if regex := self.get_option("executable"):
- if not re.search(regex, exe, re.I):
+ if self.get_option("executable"):
+ if not re.search(self.get_option("executable"), exe, re.I):
continue
cinfo = self.collect_cmd_output(f"coredumpctl info {pid}")
if cinfo['status'] != 0:
--- a/sos/collector/sosnode.py
+++ b/sos/collector/sosnode.py
@@ -372,7 +372,8 @@
for line in result.splitlines():
if not is_list:
try:
- if ls := line.split():
+ ls = line.split()
+ if ls:
res.append(ls[0])
except Exception as err:
self.log_debug(f"Error parsing sos help: {err}")

View File

@ -0,0 +1,29 @@
--- /dev/null 2025-04-03 01:35:45.132999852 +0200
+++ sos-4.9.1/bin/sosreport 2025-04-15 13:54:04.924751581 +0200
@@ -0,0 +1,5 @@
+#!/usr/bin/python3
+msg = ("sosreport binary is deprecated, use 'sos report' instead")
+print(msg)
+
+# vim:ts=4 et sw=4
--- /dev/null 2025-04-03 01:35:45.132999852 +0200
+++ sos-4.9.1/bin/sos-collector 2025-04-15 15:10:17.780281627 +0200
@@ -0,0 +1,5 @@
+#!/usr/bin/python3
+msg = ("sos-collector binary is deprecated, use 'sos collector' instead")
+print(msg)
+
+# vim:ts=4 et sw=4
--- sos-4.9.1/setup.py 2025-04-15 15:17:21.938635468 +0200
+++ sos-4.9.1/setup.py 2025-04-15 15:17:41.328198501 +0200
@@ -19,7 +19,7 @@
maintainer_email='jacob.r.hunsaker@gmail.com',
url='https://github.com/sosreport/sos',
license="GPLv2+",
- scripts=['bin/sos'],
+ scripts=['bin/sos', 'bin/sosreport', 'bin/sos-collector'],
data_files=[
('share/man/man1', ['man/en/sos-report.1', 'man/en/sos.1',
'man/en/sos-collect.1', 'man/en/sos-clean.1',

View File

@ -1,10 +1,10 @@
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%global auditversion 0.3
%global auditversion 0.3-1
Summary: A set of tools to gather troubleshooting information from a system
Name: sos
Version: 4.6.0
Version: 4.9.1
Release: 2%{?dist}
Group: Applications/System
Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz
@ -22,7 +22,11 @@ Recommends: python3-pexpect
Recommends: python3-pyyaml
Conflicts: vdsm < 4.40
Obsoletes: sos-collector
Patch1: sos-SUPDEV145-ovnkube-logs.patch
Patch1: sos-python36-walrus-operator.patch
Patch2: sosreport-binary.patch
Patch3: sos-cleaner-Use-hostname-f-in-HostnamePrepper.patch
Patch4: sos-dnf-Scrub-passwords-in-repository-URIs.patch
Patch5: sos-policy-Re-add-logic-to-request-case-id-if-not-presen.patch
%description
Sos is a set of tools that gathers information about system
@ -33,8 +37,11 @@ support technicians and developers.
%prep
%setup -qn %{name}-%{version}
%setup -T -D -a1 -q
%patch1 -p1
%patch -P 1 -p1
%patch -P 2 -p1
%patch -P 3 -p1
%patch -P 4 -p1
%patch -P 5 -p1
%build
%py3_build
@ -58,18 +65,17 @@ mkdir -p %{buildroot}%{_sysconfdir}/sos/{cleaner,presets.d,extras.d,groups.d}
# internationalization is currently broken. Uncomment this line once fixed.
# %%files -f %%{name}.lang
%files
%{_sbindir}/sosreport
%{_sbindir}/sos
%{_sbindir}/sosreport
%{_sbindir}/sos-collector
%dir /etc/sos/presets.d
%dir /etc/sos/extras.d
%dir /etc/sos/groups.d
/etc/tmpfiles.d/%{name}.conf
%{python3_sitelib}/*
%{_mandir}/man1/sosreport.1.gz
%{_mandir}/man1/sos-clean.1.gz
%{_mandir}/man1/sos-upload.1.gz
%{_mandir}/man1/sos-collect.1.gz
%{_mandir}/man1/sos-collector.1.gz
%{_mandir}/man1/sos-help.1.gz
%{_mandir}/man1/sos-mask.1.gz
%{_mandir}/man1/sos-report.1.gz
@ -82,7 +88,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/sos/{cleaner,presets.d,extras.d,groups.d}
%package audit
Summary: Audit use of some commands for support purposes
License: GPLv2+
License: GPL-2.0-or-later
Group: Application/System
%description audit
@ -105,8 +111,73 @@ of the system. Currently storage and filesystem commands are audited.
%{_mandir}/man8/sos-audit.sh.8.gz
%ghost /etc/audit/rules.d/40-sos-filesystem.rules
%ghost /etc/audit/rules.d/40-sos-storage.rules
%license LICENSE
%changelog
* Fri May 30 2025 Jan Jansky <jjansky@redhat.com> = 4.9.1-2
- Update to 4.9.1-2 in RHEL 8
Resolves: RHEL-86645
* Tue Apr 15 2025 Jan Jansky <jjansky@redhat.com> = 4.9.1-1
- Update to 4.9.1 in RHEL 8
Resolves: RHEL-86645
* Tue Jan 07 2025 Jan Jansky <jjansky@redhat.com> = 4.8.2-1
- Update to 4.8.2 in RHEL 8
Resolves: RHEL-72941
* Wed Oct 23 2024 Jan Jansky <jjansky@redhat.com> = 4.8.1-1
- Update to 4.8.1 in RHEL 8
Resolves: RHEL-64160
* Fri Sep 27 2024 Jan Jansky <jjansky@redhat.com> = 4.8.0-3
- Added credentials obfuscation from multiple files
Resolves: RHEL-58097
* Sat Sep 14 2024 Pierguido Lambri <plambri@redhat.com> = 4.8.0-2
- Resolves: RHEL-22732
Fix wrong formatting
* Mon Sep 09 2024 Pierguido Lambri <plambri@redhat.com> = 4.8.0-1
- New upstream release
Resolves: RHEL-58097
* Wed Aug 21 2024 Pavel Moravec <pmoravec@redhat.com> = 4.7.2-2
- reverting RHEL-22732 patch due to regressions
Resolves: RHEL-49779
* Fri Jun 21 2024 Pierguido Lambri <plambri@redhat.com> = 4.7.2-1
- New upstream release
Resolves: RHEL-40871
Resolves: RHEL-33703
Resolves: RHEL-22732
* Thu May 09 2024 Pavel Moravec <pmoravec@redhat.com> = 4.7.1-3
- [archive] Fix get_archive_root after files reordering
Resolves: RHEL-35945
* Mon Apr 08 2024 Jan Jansky <jjansky@redhat.com> = 4.7.1-1
- rebase to upstream 4.7.1
Resolves: RHEL-32104
* Tue Feb 20 2024 Jan Jansky <jjansky@redhat.com> = 4.7.0-1
- rebase to upstream 4.7.0
Resolves: RHEL-26111
* Thu Jan 11 2024 Pavel Moravec <pmoravec@redhat.com> = 4.6.1-1
- rebase to upstream 4.6.1
Resolves: RHEL-21173
- [redhat] Change authentication method for RHEL
Resolves: RHEL-21177
* Wed Oct 18 2023 Pavel Moravec <pmoravec@redhat.com> = 4.6.0-5
[pulpcore] Scrub AUTH_LDAP_BIND_PASSWORD value
Resolves: RHEL-13697
* Tue Oct 17 2023 Pavel Moravec <pmoravec@redhat.com> = 4.6.0-4
- [pulp] Fix dynaconf obfuscation and add AUTH_LDAP_BIND_PASSWORD
Resolves: RHEL-13697
* Fri Sep 01 2023 Pavel Moravec <pmoravec@redhat.com> = 4.6.0-2
- [openshift_ovn] Collect additional ovnkube node logs
Resolves: SUPDEV145