From bc612715bd72e17b0296b3e5867e98df79999313 Mon Sep 17 00:00:00 2001 From: pmoravec Date: Sun, 19 Dec 2021 13:40:14 +0000 Subject: [PATCH] sos updates to RHEL9.0 --- ...24893-cleaner-hostnames-improvements.patch | 53 +++++++++++++++++++ sos-bz2031777-rhui-logs.patch | 24 +++++++++ sos-bz2034001-nvidia-GPU-info.patch | 46 ++++++++++++++++ sos.spec | 14 ++++- 4 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 sos-bz2031777-rhui-logs.patch create mode 100644 sos-bz2034001-nvidia-GPU-info.patch diff --git a/sos-bz2024893-cleaner-hostnames-improvements.patch b/sos-bz2024893-cleaner-hostnames-improvements.patch index 5d71ffb..cceb1de 100644 --- a/sos-bz2024893-cleaner-hostnames-improvements.patch +++ b/sos-bz2024893-cleaner-hostnames-improvements.patch @@ -1542,3 +1542,56 @@ index 35377a31..229c7de4 100644 -- 2.31.1 +From cafd0f3a52436a3966576e7db21e5dd17c06f0cc Mon Sep 17 00:00:00 2001 +From: Jake Hunsaker +Date: Sun, 12 Dec 2021 11:10:46 -0500 +Subject: [PATCH] [hostname] Fix edge case for new hosts in a known subdomain + +Fixes an edge case that would cause us to at first not recognize that a +given hostname string is a new host in a known subdomain, but then on +the obfuscation attempt properly recognize it as such and result in an +incomplete obfuscation. + +This was mostly triggered by specific patterns for build hosts within +`sos_commands/rpm/package-data`. With this refined check, these types of +matches are properly obfuscated. + +Signed-off-by: Jake Hunsaker +--- + sos/cleaner/mappings/hostname_map.py | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/sos/cleaner/mappings/hostname_map.py b/sos/cleaner/mappings/hostname_map.py +index 5cd8e9857..33b0e6c80 100644 +--- a/sos/cleaner/mappings/hostname_map.py ++++ b/sos/cleaner/mappings/hostname_map.py +@@ -129,7 +129,7 @@ def get(self, item): + item = item[0:-1] + if not self.domain_name_in_loaded_domains(item.lower()): + return item +- if item.endswith(('.yaml', '.yml', '.crt', '.key', '.pem')): ++ if item.endswith(('.yaml', '.yml', '.crt', '.key', '.pem', '.log')): + ext = '.' + item.split('.')[-1] + item = item.replace(ext, '') + suffix += ext +@@ -148,7 +148,8 @@ def get(self, item): + if len(_test) == 1 or not _test[0]: + # does not match existing obfuscation + continue +- elif _test[0].endswith('.') and not _host_substr: ++ elif not _host_substr and (_test[0].endswith('.') or ++ item.endswith(_existing)): + # new hostname in known domain + final = super(SoSHostnameMap, self).get(item) + break +@@ -219,8 +220,8 @@ def sanitize_domain(self, domain): + # don't obfuscate vendor domains + if re.match(_skip, '.'.join(domain)): + return '.'.join(domain) +- top_domain = domain[-1] +- dname = '.'.join(domain[0:-1]) ++ top_domain = domain[-1].lower() ++ dname = '.'.join(domain[0:-1]).lower() + ob_domain = self._new_obfuscated_domain(dname) + ob_domain = '.'.join([ob_domain, top_domain]) + self.dataset['.'.join(domain)] = ob_domain diff --git a/sos-bz2031777-rhui-logs.patch b/sos-bz2031777-rhui-logs.patch new file mode 100644 index 0000000..dcfbc89 --- /dev/null +++ b/sos-bz2031777-rhui-logs.patch @@ -0,0 +1,24 @@ +From aa2887f71c779448b22e4de67ae68dbaf218b7b9 Mon Sep 17 00:00:00 2001 +From: Taft Sanders +Date: Fri, 10 Dec 2021 09:34:59 -0500 +Subject: [PATCH] [rhui] New log folder + +Included new log folder per Bugzilla 2030741 + +Signed-off-by: Taft Sanders +--- + sos/report/plugins/rhui.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sos/report/plugins/rhui.py b/sos/report/plugins/rhui.py +index 52065fb44..add024613 100644 +--- a/sos/report/plugins/rhui.py ++++ b/sos/report/plugins/rhui.py +@@ -27,6 +27,7 @@ def setup(self): + "/var/log/rhui-subscription-sync.log", + "/var/cache/rhui/*", + "/root/.rhui/*", ++ "/var/log/rhui/*", + ]) + # skip collecting certificate keys + self.add_forbidden_path("/etc/pki/rhui/**/*.key", recursive=True) diff --git a/sos-bz2034001-nvidia-GPU-info.patch b/sos-bz2034001-nvidia-GPU-info.patch new file mode 100644 index 0000000..30fbb53 --- /dev/null +++ b/sos-bz2034001-nvidia-GPU-info.patch @@ -0,0 +1,46 @@ +From f2cc67750f55a71edff0c527a1bfc14fde8132c3 Mon Sep 17 00:00:00 2001 +From: Mamatha Inamdar +Date: Mon, 8 Nov 2021 10:50:03 +0530 +Subject: [PATCH] [nvidia]:Patch to update nvidia plugin for GPU info + +This patch is to update nvidia plugin to collect +logs for Nvidia GPUs + +Signed-off-by: Mamatha Inamdar +Reported-by: Borislav Stoymirski +Reported-by: Yesenia Jimenez +--- + sos/report/plugins/nvidia.py | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/sos/report/plugins/nvidia.py b/sos/report/plugins/nvidia.py +index 09aaf586b..9e21b478e 100644 +--- a/sos/report/plugins/nvidia.py ++++ b/sos/report/plugins/nvidia.py +@@ -23,13 +23,24 @@ def setup(self): + '--list-gpus', + '-q -d PERFORMANCE', + '-q -d SUPPORTED_CLOCKS', +- '-q -d PAGE_RETIREMENT' ++ '-q -d PAGE_RETIREMENT', ++ '-q', ++ '-q -d ECC', ++ 'nvlink -s', ++ 'nvlink -e' + ] + + self.add_cmd_output(["nvidia-smi %s" % cmd for cmd in subcmds]) + + query = ('gpu_name,gpu_bus_id,vbios_version,temperature.gpu,' +- 'utilization.gpu,memory.total,memory.free,memory.used') ++ 'utilization.gpu,memory.total,memory.free,memory.used,' ++ 'clocks.applications.graphics,clocks.applications.memory') ++ querypages = ('timestamp,gpu_bus_id,gpu_serial,gpu_uuid,' ++ 'retired_pages.address,retired_pages.cause') + self.add_cmd_output("nvidia-smi --query-gpu=%s --format=csv" % query) ++ self.add_cmd_output( ++ "nvidia-smi --query-retired-pages=%s --format=csv" % querypages ++ ) ++ self.add_journal(boot=0, identifier='nvidia-persistenced') + + # vim: set et ts=4 sw=4 : diff --git a/sos.spec b/sos.spec index be7f077..b1cd45d 100644 --- a/sos.spec +++ b/sos.spec @@ -5,7 +5,7 @@ Summary: A set of tools to gather troubleshooting information from a system Name: sos Version: 4.2 -Release: 7%{?dist} +Release: 8%{?dist} Group: Applications/System Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz Source1: sos-audit-%{auditversion}.tgz @@ -39,6 +39,8 @@ Patch12: sos-bz2023481-plugin-timeouts-proper-handling.patch Patch13: sos-bz2020778-filter-namespace-per-pattern.patch Patch14: sos-bz2024893-cleaner-hostnames-improvements.patch Patch15: sos-bz2025611-RHTS-api-change.patch +Patch16: sos-bz2034001-nvidia-GPU-info.patch +Patch17: sos-bz2031777-rhui-logs.patch %description Sos is a set of tools that gathers information about system @@ -64,6 +66,8 @@ support technicians and developers. %patch13 -p1 %patch14 -p1 %patch15 -p1 +%patch16 -p1 +%patch17 -p1 %build %py3_build @@ -131,6 +135,14 @@ of the system. Currently storage and filesystem commands are audited. %changelog +* Sun Dec 19 2021 Pavel Moravec = 4.2-8 +- [rhui] New log folder + Resolves: bz2031777 +- nvidia]:Patch to update nvidia plugin for GPU info + Resolves: bz2034001 +- [hostname] Fix edge case for new hosts in a known subdomain + Resolves: bz2024893 + * Wed Dec 08 2021 Pavel Moravec = 4.2-7 - [hostname] Simplify case matching for domains Resolves: bz2024893