sos updates to RHEL 9.0 GA
Resolves: bz2011507 bz2011536 bz2011537 bz2012858 bz2019697 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
This commit is contained in:
parent
1eaffef2d0
commit
7163d4a466
69
sos-bz2011507-foreman-puma-status.patch
Normal file
69
sos-bz2011507-foreman-puma-status.patch
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
From 5a9458d318302c1caef862a868745fc8bdf5c741 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
Date: Mon, 4 Oct 2021 15:52:36 +0200
|
||||||
|
Subject: [PATCH] [foreman] Collect puma status and stats
|
||||||
|
|
||||||
|
Collect foreman-puma-status and 'pumactl [gc-|]stats', optionally using
|
||||||
|
SCL (if detected).
|
||||||
|
|
||||||
|
Resolves: #2712
|
||||||
|
|
||||||
|
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
---
|
||||||
|
sos/report/plugins/foreman.py | 21 ++++++++++++++++++++-
|
||||||
|
1 file changed, 20 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/sos/report/plugins/foreman.py b/sos/report/plugins/foreman.py
|
||||||
|
index 4539f12b..351794f4 100644
|
||||||
|
--- a/sos/report/plugins/foreman.py
|
||||||
|
+++ b/sos/report/plugins/foreman.py
|
||||||
|
@@ -13,6 +13,7 @@ from sos.report.plugins import (Plugin,
|
||||||
|
UbuntuPlugin)
|
||||||
|
from pipes import quote
|
||||||
|
from re import match
|
||||||
|
+from sos.utilities import is_executable
|
||||||
|
|
||||||
|
|
||||||
|
class Foreman(Plugin):
|
||||||
|
@@ -26,7 +27,9 @@ class Foreman(Plugin):
|
||||||
|
option_list = [
|
||||||
|
('months', 'number of months for dynflow output', 'fast', 1),
|
||||||
|
('proxyfeatures', 'collect features of smart proxies', 'slow', False),
|
||||||
|
+ ('puma-gc', 'collect Puma GC stats', 'fast', False),
|
||||||
|
]
|
||||||
|
+ pumactl = 'pumactl %s -S /usr/share/foreman/tmp/puma.state'
|
||||||
|
|
||||||
|
def setup(self):
|
||||||
|
# for external DB, search in /etc/foreman/database.yml for:
|
||||||
|
@@ -134,6 +138,17 @@ class Foreman(Plugin):
|
||||||
|
suggest_filename='dynflow_sidekiq_status')
|
||||||
|
self.add_journal(units="dynflow-sidekiq@*")
|
||||||
|
|
||||||
|
+ # Puma stats & status, i.e. foreman-puma-stats, then
|
||||||
|
+ # pumactl stats -S /usr/share/foreman/tmp/puma.state
|
||||||
|
+ # and optionally also gc-stats
|
||||||
|
+ # if on RHEL with Software Collections, wrap the commands accordingly
|
||||||
|
+ if self.get_option('puma-gc'):
|
||||||
|
+ self.add_cmd_output(self.pumactl % 'gc-stats',
|
||||||
|
+ suggest_filename='pumactl_gc-stats')
|
||||||
|
+ self.add_cmd_output(self.pumactl % 'stats',
|
||||||
|
+ suggest_filename='pumactl_stats')
|
||||||
|
+ self.add_cmd_output('/usr/sbin/foreman-puma-status')
|
||||||
|
+
|
||||||
|
# collect tables sizes, ordered
|
||||||
|
_cmd = self.build_query_cmd(
|
||||||
|
"SELECT table_name, pg_size_pretty(total_bytes) AS total, "
|
||||||
|
@@ -297,6 +312,10 @@ class RedHatForeman(Foreman, RedHatPlugin):
|
||||||
|
self.add_file_tags({
|
||||||
|
'/usr/share/foreman/.ssh/ssh_config': 'ssh_foreman_config',
|
||||||
|
})
|
||||||
|
+ # if we are on RHEL7 with scl, wrap some Puma commands by
|
||||||
|
+ # scl enable tfm 'command'
|
||||||
|
+ if self.policy.dist_version() == 7 and is_executable('scl'):
|
||||||
|
+ self.pumactl = "scl enable tfm '%s'" % self.pumactl
|
||||||
|
|
||||||
|
super(RedHatForeman, self).setup()
|
||||||
|
|
||||||
|
--
|
||||||
|
2.31.1
|
||||||
|
|
303
sos-bz2011536-iptables-based-on-ntf.patch
Normal file
303
sos-bz2011536-iptables-based-on-ntf.patch
Normal file
@ -0,0 +1,303 @@
|
|||||||
|
From 2ab8ba3ecbd52e452cc554d515e0782801dcb4b6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
Date: Wed, 8 Sep 2021 15:31:48 +0200
|
||||||
|
Subject: [PATCH] [firewalld] collect nft rules in firewall_tables only
|
||||||
|
|
||||||
|
We collect 'nft list ruleset' in both plugins, while:
|
||||||
|
- nft is not shipped by firewalld package, so we should not collect
|
||||||
|
it in firewalld plugin
|
||||||
|
- running the command requires both nf_tables and nfnetlink kmods, so
|
||||||
|
we should use both kmods in the predicate
|
||||||
|
|
||||||
|
Resolves: #2679
|
||||||
|
|
||||||
|
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
---
|
||||||
|
sos/report/plugins/firewall_tables.py | 9 +++++----
|
||||||
|
sos/report/plugins/firewalld.py | 8 +-------
|
||||||
|
2 files changed, 6 insertions(+), 11 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/sos/report/plugins/firewall_tables.py b/sos/report/plugins/firewall_tables.py
|
||||||
|
index 56058d3bf9..63a7dddeb5 100644
|
||||||
|
--- a/sos/report/plugins/firewall_tables.py
|
||||||
|
+++ b/sos/report/plugins/firewall_tables.py
|
||||||
|
@@ -40,10 +40,11 @@ def collect_nftables(self):
|
||||||
|
""" Collects nftables rulesets with 'nft' commands if the modules
|
||||||
|
are present """
|
||||||
|
|
||||||
|
- self.add_cmd_output(
|
||||||
|
- "nft list ruleset",
|
||||||
|
- pred=SoSPredicate(self, kmods=['nf_tables'])
|
||||||
|
- )
|
||||||
|
+ # collect nftables ruleset
|
||||||
|
+ nft_pred = SoSPredicate(self,
|
||||||
|
+ kmods=['nf_tables', 'nfnetlink'],
|
||||||
|
+ required={'kmods': 'all'})
|
||||||
|
+ self.add_cmd_output("nft list ruleset", pred=nft_pred, changes=True)
|
||||||
|
|
||||||
|
def setup(self):
|
||||||
|
# collect iptables -t for any existing table, if we can't read the
|
||||||
|
diff --git a/sos/report/plugins/firewalld.py b/sos/report/plugins/firewalld.py
|
||||||
|
index ec83527ed7..9401bfd239 100644
|
||||||
|
--- a/sos/report/plugins/firewalld.py
|
||||||
|
+++ b/sos/report/plugins/firewalld.py
|
||||||
|
@@ -9,7 +9,7 @@
|
||||||
|
#
|
||||||
|
# See the LICENSE file in the source distribution for further information.
|
||||||
|
|
||||||
|
-from sos.report.plugins import Plugin, RedHatPlugin, SoSPredicate
|
||||||
|
+from sos.report.plugins import Plugin, RedHatPlugin
|
||||||
|
|
||||||
|
|
||||||
|
class FirewallD(Plugin, RedHatPlugin):
|
||||||
|
@@ -35,12 +35,6 @@ def setup(self):
|
||||||
|
"/var/log/firewalld",
|
||||||
|
])
|
||||||
|
|
||||||
|
- # collect nftables ruleset
|
||||||
|
- nft_pred = SoSPredicate(self,
|
||||||
|
- kmods=['nf_tables', 'nfnetlink'],
|
||||||
|
- required={'kmods': 'all'})
|
||||||
|
- self.add_cmd_output("nft list ruleset", pred=nft_pred, changes=True)
|
||||||
|
-
|
||||||
|
# use a 10s timeout to workaround dbus problems in
|
||||||
|
# docker containers.
|
||||||
|
self.add_cmd_output([
|
||||||
|
--
|
||||||
|
2.31.1
|
||||||
|
|
||||||
|
|
||||||
|
From 2a7cf53b61943907dc823cf893530b620a87946c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
Date: Fri, 15 Oct 2021 22:31:36 +0200
|
||||||
|
Subject: [PATCH 1/3] [report] Use log_skipped_cmd method inside
|
||||||
|
collect_cmd_output
|
||||||
|
|
||||||
|
Also, remove obsolete parameters of the log_skipped_cmd method.
|
||||||
|
|
||||||
|
Related: #2724
|
||||||
|
|
||||||
|
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
---
|
||||||
|
sos/report/plugins/__init__.py | 26 ++++++++------------------
|
||||||
|
1 file changed, 8 insertions(+), 18 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/sos/report/plugins/__init__.py b/sos/report/plugins/__init__.py
|
||||||
|
index ec138f83..b60ab5f6 100644
|
||||||
|
--- a/sos/report/plugins/__init__.py
|
||||||
|
+++ b/sos/report/plugins/__init__.py
|
||||||
|
@@ -876,8 +876,7 @@ class Plugin():
|
||||||
|
return bool(pred)
|
||||||
|
return False
|
||||||
|
|
||||||
|
- def log_skipped_cmd(self, pred, cmd, kmods=False, services=False,
|
||||||
|
- changes=False):
|
||||||
|
+ def log_skipped_cmd(self, cmd, pred, changes=False):
|
||||||
|
"""Log that a command was skipped due to predicate evaluation.
|
||||||
|
|
||||||
|
Emit a warning message indicating that a command was skipped due
|
||||||
|
@@ -887,21 +886,17 @@ class Plugin():
|
||||||
|
message indicating that the missing data can be collected by using
|
||||||
|
the "--allow-system-changes" command line option will be included.
|
||||||
|
|
||||||
|
- :param pred: The predicate that caused the command to be skipped
|
||||||
|
- :type pred: ``SoSPredicate``
|
||||||
|
-
|
||||||
|
:param cmd: The command that was skipped
|
||||||
|
:type cmd: ``str``
|
||||||
|
|
||||||
|
- :param kmods: Did kernel modules cause the command to be skipped
|
||||||
|
- :type kmods: ``bool``
|
||||||
|
-
|
||||||
|
- :param services: Did services cause the command to be skipped
|
||||||
|
- :type services: ``bool``
|
||||||
|
+ :param pred: The predicate that caused the command to be skipped
|
||||||
|
+ :type pred: ``SoSPredicate``
|
||||||
|
|
||||||
|
:param changes: Is the `--allow-system-changes` enabled
|
||||||
|
:type changes: ``bool``
|
||||||
|
"""
|
||||||
|
+ if pred is None:
|
||||||
|
+ pred = SoSPredicate(self)
|
||||||
|
msg = "skipped command '%s': %s" % (cmd, pred.report_failure())
|
||||||
|
|
||||||
|
if changes:
|
||||||
|
@@ -1700,9 +1693,7 @@ class Plugin():
|
||||||
|
self.collect_cmds.append(soscmd)
|
||||||
|
self._log_info("added cmd output '%s'" % soscmd.cmd)
|
||||||
|
else:
|
||||||
|
- self.log_skipped_cmd(pred, soscmd.cmd, kmods=bool(pred.kmods),
|
||||||
|
- services=bool(pred.services),
|
||||||
|
- changes=soscmd.changes)
|
||||||
|
+ self.log_skipped_cmd(soscmd.cmd, pred, changes=soscmd.changes)
|
||||||
|
|
||||||
|
def add_cmd_output(self, cmds, suggest_filename=None,
|
||||||
|
root_symlink=None, timeout=None, stderr=True,
|
||||||
|
@@ -2112,7 +2103,7 @@ class Plugin():
|
||||||
|
root_symlink=False, timeout=None,
|
||||||
|
stderr=True, chroot=True, runat=None, env=None,
|
||||||
|
binary=False, sizelimit=None, pred=None,
|
||||||
|
- subdir=None, tags=[]):
|
||||||
|
+ changes=False, subdir=None, tags=[]):
|
||||||
|
"""Execute a command and save the output to a file for inclusion in the
|
||||||
|
report, then return the results for further use by the plugin
|
||||||
|
|
||||||
|
@@ -2163,8 +2154,7 @@ class Plugin():
|
||||||
|
:rtype: ``dict``
|
||||||
|
"""
|
||||||
|
if not self.test_predicate(cmd=True, pred=pred):
|
||||||
|
- self._log_info("skipped cmd output '%s' due to predicate (%s)" %
|
||||||
|
- (cmd, self.get_predicate(cmd=True, pred=pred)))
|
||||||
|
+ self.log_skipped_cmd(cmd, pred, changes=changes)
|
||||||
|
return {
|
||||||
|
'status': None, # don't match on if result['status'] checks
|
||||||
|
'output': '',
|
||||||
|
--
|
||||||
|
2.31.1
|
||||||
|
|
||||||
|
|
||||||
|
From 6b1bea0ffb1df7f8e5001b06cf25f0741b007ddd Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
Date: Fri, 15 Oct 2021 22:34:01 +0200
|
||||||
|
Subject: [PATCH 2/3] [firewall_tables] call iptables -t <table> based on nft
|
||||||
|
list
|
||||||
|
|
||||||
|
If iptables are not realy in use, calling iptables -t <table>
|
||||||
|
would load corresponding nft table.
|
||||||
|
|
||||||
|
Therefore, call iptables -t only for the tables from "nft list ruleset"
|
||||||
|
output.
|
||||||
|
|
||||||
|
Example: nft list ruleset contains
|
||||||
|
|
||||||
|
table ip mangle {
|
||||||
|
..
|
||||||
|
}
|
||||||
|
|
||||||
|
so we can collect iptable -t mangle -nvL .
|
||||||
|
|
||||||
|
The same applies to ip6tables as well.
|
||||||
|
|
||||||
|
Resolves: #2724
|
||||||
|
|
||||||
|
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
---
|
||||||
|
sos/report/plugins/firewall_tables.py | 29 ++++++++++++++++++++-------
|
||||||
|
1 file changed, 22 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/sos/report/plugins/firewall_tables.py b/sos/report/plugins/firewall_tables.py
|
||||||
|
index 63a7ddde..ef04d939 100644
|
||||||
|
--- a/sos/report/plugins/firewall_tables.py
|
||||||
|
+++ b/sos/report/plugins/firewall_tables.py
|
||||||
|
@@ -44,26 +44,41 @@ class firewall_tables(Plugin, IndependentPlugin):
|
||||||
|
nft_pred = SoSPredicate(self,
|
||||||
|
kmods=['nf_tables', 'nfnetlink'],
|
||||||
|
required={'kmods': 'all'})
|
||||||
|
- self.add_cmd_output("nft list ruleset", pred=nft_pred, changes=True)
|
||||||
|
+ return self.collect_cmd_output("nft list ruleset", pred=nft_pred,
|
||||||
|
+ changes=True)
|
||||||
|
|
||||||
|
def setup(self):
|
||||||
|
+ # first, collect "nft list ruleset" as collecting commands like
|
||||||
|
+ # ip6tables -t mangle -nvL
|
||||||
|
+ # depends on its output
|
||||||
|
+ # store in nft_ip_tables lists of ip[|6] tables from nft list
|
||||||
|
+ nft_list = self.collect_nftables()
|
||||||
|
+ nft_ip_tables = {'ip': [], 'ip6': []}
|
||||||
|
+ nft_lines = nft_list['output'] if nft_list['status'] == 0 else ''
|
||||||
|
+ for line in nft_lines.splitlines():
|
||||||
|
+ words = line.split()[0:3]
|
||||||
|
+ if len(words) == 3 and words[0] == 'table' and \
|
||||||
|
+ words[1] in nft_ip_tables.keys():
|
||||||
|
+ nft_ip_tables[words[1]].append(words[2])
|
||||||
|
# collect iptables -t for any existing table, if we can't read the
|
||||||
|
# tables, collect 2 default ones (mangle, filter)
|
||||||
|
+ # do collect them only when relevant nft list ruleset exists
|
||||||
|
+ default_ip_tables = "mangle\nfilter\n"
|
||||||
|
try:
|
||||||
|
ip_tables_names = open("/proc/net/ip_tables_names").read()
|
||||||
|
except IOError:
|
||||||
|
- ip_tables_names = "mangle\nfilter\n"
|
||||||
|
+ ip_tables_names = default_ip_tables
|
||||||
|
for table in ip_tables_names.splitlines():
|
||||||
|
- self.collect_iptable(table)
|
||||||
|
+ if nft_list['status'] == 0 and table in nft_ip_tables['ip']:
|
||||||
|
+ self.collect_iptable(table)
|
||||||
|
# collect the same for ip6tables
|
||||||
|
try:
|
||||||
|
ip_tables_names = open("/proc/net/ip6_tables_names").read()
|
||||||
|
except IOError:
|
||||||
|
- ip_tables_names = "mangle\nfilter\n"
|
||||||
|
+ ip_tables_names = default_ip_tables
|
||||||
|
for table in ip_tables_names.splitlines():
|
||||||
|
- self.collect_ip6table(table)
|
||||||
|
-
|
||||||
|
- self.collect_nftables()
|
||||||
|
+ if nft_list['status'] == 0 and table in nft_ip_tables['ip6']:
|
||||||
|
+ self.collect_ip6table(table)
|
||||||
|
|
||||||
|
# When iptables is called it will load the modules
|
||||||
|
# iptables_filter (for kernel <= 3) or
|
||||||
|
--
|
||||||
|
2.31.1
|
||||||
|
|
||||||
|
|
||||||
|
From 464bd2d2e83f203e369f2ba7671bbb7da53e06f6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
Date: Sun, 24 Oct 2021 16:00:31 +0200
|
||||||
|
Subject: [PATCH 3/3] [firewall_tables] Call iptables only when nft ip filter
|
||||||
|
table exists
|
||||||
|
|
||||||
|
iptables -vnxL creates nft 'ip filter' table if it does not exist, hence
|
||||||
|
we must guard iptables execution by presence of the nft table.
|
||||||
|
|
||||||
|
An equivalent logic applies to ip6tables.
|
||||||
|
|
||||||
|
Resolves: #2724
|
||||||
|
|
||||||
|
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
---
|
||||||
|
sos/report/plugins/firewall_tables.py | 26 ++++++++++++++------------
|
||||||
|
1 file changed, 14 insertions(+), 12 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/sos/report/plugins/firewall_tables.py b/sos/report/plugins/firewall_tables.py
|
||||||
|
index ef04d939..7eafd60f 100644
|
||||||
|
--- a/sos/report/plugins/firewall_tables.py
|
||||||
|
+++ b/sos/report/plugins/firewall_tables.py
|
||||||
|
@@ -80,19 +80,21 @@ class firewall_tables(Plugin, IndependentPlugin):
|
||||||
|
if nft_list['status'] == 0 and table in nft_ip_tables['ip6']:
|
||||||
|
self.collect_ip6table(table)
|
||||||
|
|
||||||
|
- # When iptables is called it will load the modules
|
||||||
|
- # iptables_filter (for kernel <= 3) or
|
||||||
|
- # nf_tables (for kernel >= 4) if they are not loaded.
|
||||||
|
+ # When iptables is called it will load:
|
||||||
|
+ # 1) the modules iptables_filter (for kernel <= 3) or
|
||||||
|
+ # nf_tables (for kernel >= 4) if they are not loaded.
|
||||||
|
+ # 2) nft 'ip filter' table will be created
|
||||||
|
# The same goes for ipv6.
|
||||||
|
- self.add_cmd_output(
|
||||||
|
- "iptables -vnxL",
|
||||||
|
- pred=SoSPredicate(self, kmods=['iptable_filter', 'nf_tables'])
|
||||||
|
- )
|
||||||
|
-
|
||||||
|
- self.add_cmd_output(
|
||||||
|
- "ip6tables -vnxL",
|
||||||
|
- pred=SoSPredicate(self, kmods=['ip6table_filter', 'nf_tables'])
|
||||||
|
- )
|
||||||
|
+ if nft_list['status'] != 0 or 'filter' in nft_ip_tables['ip']:
|
||||||
|
+ self.add_cmd_output(
|
||||||
|
+ "iptables -vnxL",
|
||||||
|
+ pred=SoSPredicate(self, kmods=['iptable_filter', 'nf_tables'])
|
||||||
|
+ )
|
||||||
|
+ if nft_list['status'] != 0 or 'filter' in nft_ip_tables['ip6']:
|
||||||
|
+ self.add_cmd_output(
|
||||||
|
+ "ip6tables -vnxL",
|
||||||
|
+ pred=SoSPredicate(self, kmods=['ip6table_filter', 'nf_tables'])
|
||||||
|
+ )
|
||||||
|
|
||||||
|
self.add_copy_spec([
|
||||||
|
"/etc/nftables",
|
||||||
|
--
|
||||||
|
2.31.1
|
||||||
|
|
@ -177,3 +177,81 @@ index 82484f1d..b033f621 100644
|
|||||||
--
|
--
|
||||||
2.31.1
|
2.31.1
|
||||||
|
|
||||||
|
From 7ae47e6c0717c0b56c3368008dd99a87f7f436d5 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
Date: Wed, 13 Oct 2021 20:21:16 +0200
|
||||||
|
Subject: [PATCH] [report] Count with sos_logs and sos_reports in
|
||||||
|
--estimate-only
|
||||||
|
|
||||||
|
Currently, we estimate just plugins' disk space and ignore sos_logs
|
||||||
|
or sos_reports directories - although they can occupy nontrivial disk
|
||||||
|
space as well.
|
||||||
|
|
||||||
|
Resolves: #2723
|
||||||
|
|
||||||
|
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
---
|
||||||
|
sos/report/__init__.py | 8 ++++++++
|
||||||
|
1 file changed, 8 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/sos/report/__init__.py b/sos/report/__init__.py
|
||||||
|
index e35c7e8d..7feb31ee 100644
|
||||||
|
--- a/sos/report/__init__.py
|
||||||
|
+++ b/sos/report/__init__.py
|
||||||
|
@@ -1380,6 +1380,14 @@ class SoSReport(SoSComponent):
|
||||||
|
|
||||||
|
if self.opts.estimate_only:
|
||||||
|
from sos.utilities import get_human_readable
|
||||||
|
+ from pathlib import Path
|
||||||
|
+ # add sos_logs, sos_reports dirs, etc., basically everything
|
||||||
|
+ # that remained in self.tmpdir after plugins' contents removal
|
||||||
|
+ # that still will be moved to the sos report final directory path
|
||||||
|
+ tmpdir_path = Path(self.tmpdir)
|
||||||
|
+ self.estimated_plugsizes['sos_logs_reports'] = sum(
|
||||||
|
+ [f.stat().st_size for f in tmpdir_path.glob('**/*')])
|
||||||
|
+
|
||||||
|
_sum = get_human_readable(sum(self.estimated_plugsizes.values()))
|
||||||
|
self.ui_log.info("Estimated disk space requirement for whole "
|
||||||
|
"uncompressed sos report directory: %s" % _sum)
|
||||||
|
--
|
||||||
|
2.31.1
|
||||||
|
|
||||||
|
From 4293f3317505661e8f32ba94ad87310996fa1626 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Eric Desrochers <eric.desrochers@canonical.com>
|
||||||
|
Date: Tue, 19 Oct 2021 12:18:40 -0400
|
||||||
|
Subject: [PATCH] [report] check for symlink before rmtree when opt
|
||||||
|
estimate-only is use
|
||||||
|
|
||||||
|
Check if the dir is also symlink before performing rmtree()
|
||||||
|
method so that unlink() method can be used instead.
|
||||||
|
|
||||||
|
Traceback (most recent call last):
|
||||||
|
File "./bin/sos", line 22, in <module>
|
||||||
|
sos.execute()
|
||||||
|
File "/tmp/sos/sos/__init__.py", line 186, in execute
|
||||||
|
self._component.execute()
|
||||||
|
OSError: Cannot call rmtree on a symbolic link
|
||||||
|
|
||||||
|
Closes: #2727
|
||||||
|
|
||||||
|
Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com>
|
||||||
|
---
|
||||||
|
sos/report/__init__.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/sos/report/__init__.py b/sos/report/__init__.py
|
||||||
|
index 7feb31ee..1b5bc97d 100644
|
||||||
|
--- a/sos/report/__init__.py
|
||||||
|
+++ b/sos/report/__init__.py
|
||||||
|
@@ -1059,7 +1059,7 @@ class SoSReport(SoSComponent):
|
||||||
|
# deletion of some dirs but deleting their content
|
||||||
|
for f in os.listdir(self.archive.get_tmp_dir()):
|
||||||
|
f = os.path.join(self.archive.get_tmp_dir(), f)
|
||||||
|
- if os.path.isdir(f):
|
||||||
|
+ if os.path.isdir(f) and not os.path.islink(f):
|
||||||
|
rmtree(f)
|
||||||
|
else:
|
||||||
|
os.unlink(f)
|
||||||
|
--
|
||||||
|
2.31.1
|
||||||
|
|
||||||
|
33
sos-bz2012858-dryrun-uncaught-exception.patch
Normal file
33
sos-bz2012858-dryrun-uncaught-exception.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
From e56b3ea999731b831ebba80cf367e43e65c12b62 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
Date: Mon, 4 Oct 2021 14:43:08 +0200
|
||||||
|
Subject: [PATCH] [report] Overwrite pred=None before refering predicate
|
||||||
|
attributes
|
||||||
|
|
||||||
|
During a dry run, add_journal method sets pred=None whilst log_skipped_cmd
|
||||||
|
refers to predicate attributes. In that case, replace None predicate
|
||||||
|
by a default / empty predicate.
|
||||||
|
|
||||||
|
Resolves: #2711
|
||||||
|
|
||||||
|
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
|
||||||
|
---
|
||||||
|
sos/report/plugins/__init__.py | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/sos/report/plugins/__init__.py b/sos/report/plugins/__init__.py
|
||||||
|
index 3c2b64d9..c635b8de 100644
|
||||||
|
--- a/sos/report/plugins/__init__.py
|
||||||
|
+++ b/sos/report/plugins/__init__.py
|
||||||
|
@@ -1693,6 +1693,8 @@ class Plugin():
|
||||||
|
def _add_cmd_output(self, **kwargs):
|
||||||
|
"""Internal helper to add a single command to the collection list."""
|
||||||
|
pred = kwargs.pop('pred') if 'pred' in kwargs else SoSPredicate(self)
|
||||||
|
+ if pred is None:
|
||||||
|
+ pred = SoSPredicate(self)
|
||||||
|
if 'priority' not in kwargs:
|
||||||
|
kwargs['priority'] = 10
|
||||||
|
if 'changes' not in kwargs:
|
||||||
|
--
|
||||||
|
2.31.1
|
||||||
|
|
151
sos-bz2019697-openvswitch-offline-analysis.patch
Normal file
151
sos-bz2019697-openvswitch-offline-analysis.patch
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
From 3f0ec3e55e7dcec89dd7fad10084ea7f16178608 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Salvatore Daniele <sdaniele@redhat.com>
|
||||||
|
Date: Tue, 7 Sep 2021 13:48:22 -0400
|
||||||
|
Subject: [PATCH 1/2] [openvswitch] add ovs default OpenFlow protocols
|
||||||
|
|
||||||
|
ovs-vsctl list bridge can return an empty 'protocol' column even when
|
||||||
|
there are OpenFlow protocols in place by default.
|
||||||
|
|
||||||
|
ovs-ofctl --version will return the range of supported ofp and should
|
||||||
|
also be used to ensure flow information for relevant protocol versions
|
||||||
|
is collected.
|
||||||
|
|
||||||
|
OpenFlow default versions:
|
||||||
|
https://docs.openvswitch.org/en/latest/faq/openflow/
|
||||||
|
|
||||||
|
Signed-off-by: Salvatore Daniele <sdaniele@redhat.com>
|
||||||
|
---
|
||||||
|
sos/report/plugins/openvswitch.py | 26 ++++++++++++++++++++++++++
|
||||||
|
1 file changed, 26 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/sos/report/plugins/openvswitch.py b/sos/report/plugins/openvswitch.py
|
||||||
|
index cd897db2..92cc7259 100644
|
||||||
|
--- a/sos/report/plugins/openvswitch.py
|
||||||
|
+++ b/sos/report/plugins/openvswitch.py
|
||||||
|
@@ -206,6 +206,7 @@ class OpenVSwitch(Plugin):
|
||||||
|
|
||||||
|
# Gather additional output for each OVS bridge on the host.
|
||||||
|
br_list_result = self.collect_cmd_output("ovs-vsctl -t 5 list-br")
|
||||||
|
+ ofp_ver_result = self.collect_cmd_output("ovs-ofctl -t 5 --version")
|
||||||
|
if br_list_result['status'] == 0:
|
||||||
|
for br in br_list_result['output'].splitlines():
|
||||||
|
self.add_cmd_output([
|
||||||
|
@@ -232,6 +233,16 @@ class OpenVSwitch(Plugin):
|
||||||
|
"OpenFlow15"
|
||||||
|
]
|
||||||
|
|
||||||
|
+ # Flow protocol hex identifiers
|
||||||
|
+ ofp_versions = {
|
||||||
|
+ 0x01: "OpenFlow10",
|
||||||
|
+ 0x02: "OpenFlow11",
|
||||||
|
+ 0x03: "OpenFlow12",
|
||||||
|
+ 0x04: "OpenFlow13",
|
||||||
|
+ 0x05: "OpenFlow14",
|
||||||
|
+ 0x06: "OpenFlow15",
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
# List protocols currently in use, if any
|
||||||
|
ovs_list_bridge_cmd = "ovs-vsctl -t 5 list bridge %s" % br
|
||||||
|
br_info = self.collect_cmd_output(ovs_list_bridge_cmd)
|
||||||
|
@@ -242,6 +253,21 @@ class OpenVSwitch(Plugin):
|
||||||
|
br_protos_ln = line[line.find("[")+1:line.find("]")]
|
||||||
|
br_protos = br_protos_ln.replace('"', '').split(", ")
|
||||||
|
|
||||||
|
+ # If 'list bridge' yeilded no protocols, use the range of
|
||||||
|
+ # protocols enabled by default on this version of ovs.
|
||||||
|
+ if br_protos == [''] and ofp_ver_result['output']:
|
||||||
|
+ ofp_version_range = ofp_ver_result['output'].splitlines()
|
||||||
|
+ ver_range = []
|
||||||
|
+
|
||||||
|
+ for line in ofp_version_range:
|
||||||
|
+ if "OpenFlow versions" in line:
|
||||||
|
+ v = line.split("OpenFlow versions ")[1].split(":")
|
||||||
|
+ ver_range = range(int(v[0], 16), int(v[1], 16)+1)
|
||||||
|
+
|
||||||
|
+ for protocol in ver_range:
|
||||||
|
+ if protocol in ofp_versions:
|
||||||
|
+ br_protos.append(ofp_versions[protocol])
|
||||||
|
+
|
||||||
|
# Collect flow information for relevant protocol versions only
|
||||||
|
for flow in flow_versions:
|
||||||
|
if flow in br_protos:
|
||||||
|
--
|
||||||
|
2.31.1
|
||||||
|
|
||||||
|
|
||||||
|
From 5a006024f730213a726c70e82c5ecd2daf685b2b Mon Sep 17 00:00:00 2001
|
||||||
|
From: Salvatore Daniele <sdaniele@redhat.com>
|
||||||
|
Date: Tue, 7 Sep 2021 14:17:19 -0400
|
||||||
|
Subject: [PATCH 2/2] [openvswitch] add commands for offline analysis
|
||||||
|
|
||||||
|
Replicas of ovs-vswitchd and ovsdb-server can be recreated offline
|
||||||
|
using flow, group, and tlv dumps, and ovs conf.db. This allows for
|
||||||
|
offline anaylsis and the use of tools such as ovs-appctl
|
||||||
|
ofproto/trace and ovs-ofctl for debugging.
|
||||||
|
|
||||||
|
This patch ensures this information is available in the sos report.
|
||||||
|
The db is copied rather than collected using ovsdb-client list dump
|
||||||
|
for two reasons:
|
||||||
|
|
||||||
|
ovsdb-client requires interacting with the ovsdb-server which could
|
||||||
|
take it 'down' for some time, and impact large, busy clusters.
|
||||||
|
|
||||||
|
The list-dump is not in a format that can be used to restore the db
|
||||||
|
offline. All of the information in the list dump is available and more
|
||||||
|
by copying the db.
|
||||||
|
|
||||||
|
Signed-off-by: Salvatore Daniele <sdaniele@redhat.com>
|
||||||
|
---
|
||||||
|
sos/report/plugins/openvswitch.py | 12 ++++++++++--
|
||||||
|
sos/report/plugins/ovn_central.py | 1 +
|
||||||
|
2 files changed, 11 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/sos/report/plugins/openvswitch.py b/sos/report/plugins/openvswitch.py
|
||||||
|
index 92cc7259..003596c6 100644
|
||||||
|
--- a/sos/report/plugins/openvswitch.py
|
||||||
|
+++ b/sos/report/plugins/openvswitch.py
|
||||||
|
@@ -75,12 +75,19 @@ class OpenVSwitch(Plugin):
|
||||||
|
"/run/openvswitch/ovs-monitor-ipsec.pid"
|
||||||
|
])
|
||||||
|
|
||||||
|
+ self.add_copy_spec([
|
||||||
|
+ path_join('/usr/local/etc/openvswitch', 'conf.db'),
|
||||||
|
+ path_join('/etc/openvswitch', 'conf.db'),
|
||||||
|
+ path_join('/var/lib/openvswitch', 'conf.db'),
|
||||||
|
+ ])
|
||||||
|
+ ovs_dbdir = environ.get('OVS_DBDIR')
|
||||||
|
+ if ovs_dbdir:
|
||||||
|
+ self.add_copy_spec(path_join(ovs_dbdir, 'conf.db'))
|
||||||
|
+
|
||||||
|
self.add_cmd_output([
|
||||||
|
# The '-t 5' adds an upper bound on how long to wait to connect
|
||||||
|
# to the Open vSwitch server, avoiding hangs when running sos.
|
||||||
|
"ovs-vsctl -t 5 show",
|
||||||
|
- # Gather the database.
|
||||||
|
- "ovsdb-client -f list dump",
|
||||||
|
# List the contents of important runtime directories
|
||||||
|
"ls -laZ /run/openvswitch",
|
||||||
|
"ls -laZ /dev/hugepages/",
|
||||||
|
@@ -276,6 +283,7 @@ class OpenVSwitch(Plugin):
|
||||||
|
"ovs-ofctl -O %s dump-groups %s" % (flow, br),
|
||||||
|
"ovs-ofctl -O %s dump-group-stats %s" % (flow, br),
|
||||||
|
"ovs-ofctl -O %s dump-flows %s" % (flow, br),
|
||||||
|
+ "ovs-ofctl -O %s dump-tlv-map %s" % (flow, br),
|
||||||
|
"ovs-ofctl -O %s dump-ports-desc %s" % (flow, br)
|
||||||
|
])
|
||||||
|
|
||||||
|
diff --git a/sos/report/plugins/ovn_central.py b/sos/report/plugins/ovn_central.py
|
||||||
|
index a4c483a9..d6647aad 100644
|
||||||
|
--- a/sos/report/plugins/ovn_central.py
|
||||||
|
+++ b/sos/report/plugins/ovn_central.py
|
||||||
|
@@ -138,6 +138,7 @@ class OVNCentral(Plugin):
|
||||||
|
os.path.join('/usr/local/etc/openvswitch', dbfile),
|
||||||
|
os.path.join('/etc/openvswitch', dbfile),
|
||||||
|
os.path.join('/var/lib/openvswitch', dbfile),
|
||||||
|
+ os.path.join('/var/lib/ovn/etc', dbfile),
|
||||||
|
])
|
||||||
|
if ovs_dbdir:
|
||||||
|
self.add_copy_spec(os.path.join(ovs_dbdir, dbfile))
|
||||||
|
--
|
||||||
|
2.31.1
|
||||||
|
|
22
sos.spec
22
sos.spec
@ -5,7 +5,7 @@
|
|||||||
Summary: A set of tools to gather troubleshooting information from a system
|
Summary: A set of tools to gather troubleshooting information from a system
|
||||||
Name: sos
|
Name: sos
|
||||||
Version: 4.2
|
Version: 4.2
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
Group: Applications/System
|
Group: Applications/System
|
||||||
Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz
|
Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz
|
||||||
Source1: sos-audit-%{auditversion}.tgz
|
Source1: sos-audit-%{auditversion}.tgz
|
||||||
@ -30,6 +30,10 @@ Patch3: sos-bz2011534-opacapture-under-allow-system-changes.patch
|
|||||||
Patch4: sos-bz2011535-kernel-psi.patch
|
Patch4: sos-bz2011535-kernel-psi.patch
|
||||||
Patch5: sos-bz2011538-iptables-save-under-nf_tables-kmod.patch
|
Patch5: sos-bz2011538-iptables-save-under-nf_tables-kmod.patch
|
||||||
Patch6: sos-bz2011537-estimate-only-option.patch
|
Patch6: sos-bz2011537-estimate-only-option.patch
|
||||||
|
Patch7: sos-bz2011536-iptables-based-on-ntf.patch
|
||||||
|
Patch8: sos-bz2011507-foreman-puma-status.patch
|
||||||
|
Patch9: sos-bz2012858-dryrun-uncaught-exception.patch
|
||||||
|
Patch10: sos-bz2019697-openvswitch-offline-analysis.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Sos is a set of tools that gathers information about system
|
Sos is a set of tools that gathers information about system
|
||||||
@ -46,6 +50,10 @@ support technicians and developers.
|
|||||||
%patch4 -p1
|
%patch4 -p1
|
||||||
%patch5 -p1
|
%patch5 -p1
|
||||||
%patch6 -p1
|
%patch6 -p1
|
||||||
|
%patch7 -p1
|
||||||
|
%patch8 -p1
|
||||||
|
%patch9 -p1
|
||||||
|
%patch10 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%py3_build
|
%py3_build
|
||||||
@ -113,6 +121,18 @@ of the system. Currently storage and filesystem commands are audited.
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Nov 03 2021 Pavel Moravec <pmoravec@redhat.com> = 4.2-2
|
||||||
|
- [firewall_tables] call iptables -t <table> based on nft
|
||||||
|
Resolves: bz2011536
|
||||||
|
- [report] Count with sos_logs and sos_reports in
|
||||||
|
Resolves: bz2011537
|
||||||
|
- [foreman] Collect puma status and stats
|
||||||
|
Resolves: bz2011507
|
||||||
|
- [report] Overwrite pred=None before refering predicate
|
||||||
|
Resolves: bz2012858
|
||||||
|
- [openvswitch] add commands for offline analysis
|
||||||
|
Resolves: bz2019697
|
||||||
|
|
||||||
* Wed Oct 06 2021 Pavel Moravec <pmoravec@redhat.com> = 4.2-1
|
* Wed Oct 06 2021 Pavel Moravec <pmoravec@redhat.com> = 4.2-1
|
||||||
- Rebase on upstream 4.2
|
- Rebase on upstream 4.2
|
||||||
Resolves: bz1998134
|
Resolves: bz1998134
|
||||||
|
Loading…
Reference in New Issue
Block a user