diff -Nru sosreport-3.9.1/debian/changelog sosreport-3.9.1/debian/changelog --- sosreport-3.9.1/debian/changelog 2020-07-07 19:34:42.000000000 +0000 +++ sosreport-3.9.1/debian/changelog 2020-11-23 18:10:12.000000000 +0000 @@ -1,3 +1,16 @@ +sosreport (3.9.1-1ubuntu0.18.04.3) bionic; urgency=medium + + [Hemanth Nakkina] + * d/p/0005-conntrack-add-conntrack-info.patch: rename the + conntrackd plugin to conntrack; add conntrack commands. + (LP: #1898077) + + [Mauricio Oliveira] + * d/p/0006-conntrack-gather-per-namespace-data.patch: add + conntrack commands for network namespaces. + + -- Mauricio Faria de Oliveira Mon, 23 Nov 2020 15:10:12 -0300 + sosreport (3.9.1-1ubuntu0.18.04.2) bionic; urgency=medium * d/p/0004-maas-add-snap-support.patch (LP: #1886494) diff -Nru sosreport-3.9.1/debian/patches/0005-conntrack-add-conntrack-info.patch sosreport-3.9.1/debian/patches/0005-conntrack-add-conntrack-info.patch --- sosreport-3.9.1/debian/patches/0005-conntrack-add-conntrack-info.patch 1970-01-01 00:00:00.000000000 +0000 +++ sosreport-3.9.1/debian/patches/0005-conntrack-add-conntrack-info.patch 2020-11-23 18:10:12.000000000 +0000 @@ -0,0 +1,111 @@ +Origin: backport, https://github.com/sosreport/sos/commit/e6af5287b6bde901690c58090f958960a536660a +Description: + The backport is actually a change for the patch rename approach to work + in Bionic (error msg: "Cannot rename file without two valid file names") + that just removes the old file, and adds the new file. +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1898077 +From: Hemanth Nakkina +Date: Sun, 27 Sep 2020 02:28:11 +0000 +Subject: [PATCH] [conntrack] add conntrack info + +The plugin conntrackd is renamed to conntrack. Added the following +conntrack commands to the plugin. +conntrack -L -o extended +conntrack -S + +Closes: #2049 +Resolves: #2251 + +Signed-off-by: Hemanth Nakkina hemanth.nakkina@canonical.com +Signed-off-by: Jake Hunsaker +--- + .../plugins/{conntrackd.py => conntrack.py} | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + rename sos/report/plugins/{conntrackd.py => conntrack.py} (70%) + + + +--- sosreport-3.9.1.orig/sos/plugins/conntrackd.py ++++ /dev/null +@@ -1,36 +0,0 @@ +-# Copyright (C) 2017 Red Hat, Inc., Marcus Linden +-# 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, DebianPlugin, UbuntuPlugin, \ +- SuSEPlugin +- +- +-class Conntrackd(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin, SuSEPlugin): +- """conntrackd - netfilter connection tracking user-space daemon +- """ +- +- plugin_name = 'conntrackd' +- profiles = ('network', 'cluster') +- +- packages = ('conntrack-tools', 'conntrackd') +- +- def setup(self): +- self.add_copy_spec("/etc/conntrackd/conntrackd.conf") +- self.add_cmd_output([ +- "conntrackd -s network", +- "conntrackd -s cache", +- "conntrackd -s runtime", +- "conntrackd -s link", +- "conntrackd -s rsqueue", +- "conntrackd -s queue", +- "conntrackd -s ct", +- "conntrackd -s expect", +- ]) +- +-# vim: set et ts=4 sw=4 : +--- /dev/null ++++ sosreport-3.9.1/sos/plugins/conntrack.py +@@ -0,0 +1,42 @@ ++# Copyright (C) 2017 Red Hat, Inc., Marcus Linden ++# 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, DebianPlugin, UbuntuPlugin, \ ++ SuSEPlugin ++ ++ ++class Conntrack(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin, SuSEPlugin): ++ """conntrack - netfilter connection tracking ++ """ ++ ++ plugin_name = 'conntrack' ++ profiles = ('network', 'cluster') ++ ++ packages = ('conntrack-tools', 'conntrack', 'conntrackd') ++ ++ def setup(self): ++ self.add_copy_spec("/etc/conntrackd/conntrackd.conf") ++ self.add_cmd_output([ ++ "conntrackd -s network", ++ "conntrackd -s cache", ++ "conntrackd -s runtime", ++ "conntrackd -s link", ++ "conntrackd -s rsqueue", ++ "conntrackd -s queue", ++ "conntrackd -s ct", ++ "conntrackd -s expect", ++ ]) ++ ++ # Collect info from conntrack ++ self.add_cmd_output([ ++ "conntrack -L -o extended", ++ "conntrack -S", ++ ]) ++ ++# vim: set et ts=4 sw=4 : diff -Nru sosreport-3.9.1/debian/patches/0006-conntrack-gather-per-namespace-data.patch sosreport-3.9.1/debian/patches/0006-conntrack-gather-per-namespace-data.patch --- sosreport-3.9.1/debian/patches/0006-conntrack-gather-per-namespace-data.patch 1970-01-01 00:00:00.000000000 +0000 +++ sosreport-3.9.1/debian/patches/0006-conntrack-gather-per-namespace-data.patch 2020-11-23 18:10:12.000000000 +0000 @@ -0,0 +1,95 @@ +Origin: backport, https://github.com/sosreport/sos/commit/ef6e1bd537a9da2c0368b15988755bc4412b39e8 +Description: + The backport is only a change to the file path: + - upstream: sos/report/plugins/conntrack.py + - backport: sos/plugins/conntrack.py +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1898077 +From ef6e1bd537a9da2c0368b15988755bc4412b39e8 Mon Sep 17 00:00:00 2001 +From: Mauricio Faria de Oliveira +Date: Wed, 11 Nov 2020 23:52:51 +0000 +Subject: [PATCH] [conntrack] gather per-namespace data + +Run conntrack commands per-namespace, as the ebpf/networking plugins: + +Test-case: +``` + # ip netns + ns3 + ns2 + ns1 +``` + +Before: +``` + # ./bin/sos report -o conntrack,ebpf,networking --batch + + # tar tf /tmp/sosreport-*.tar.xz | grep ip_netns_exec + .../sos_commands/ebpf/ip_netns_exec_ns1_bpftool_net_list + .../sos_commands/ebpf/ip_netns_exec_ns2_bpftool_net_list + .../sos_commands/ebpf/ip_netns_exec_ns3_bpftool_net_list + ... + .../sos_commands/networking/ip_netns_exec_ns1_ip_address_show + ... + .../sos_commands/networking/ip_netns_exec_ns2_ip_address_show + ... + .../sos_commands/networking/ip_netns_exec_ns3_ip_address_show + ... +``` + +After: + +``` + # ./bin/sos report -o conntrack,ebpf,networking --batch + + # tar tf /tmp/sosreport-*.tar.xz | grep ip_netns_exec + .../sos_commands/conntrack/ip_netns_exec_ns1_conntrack_-L_-o_extended + .../sos_commands/conntrack/ip_netns_exec_ns1_conntrack_-S + .../sos_commands/conntrack/ip_netns_exec_ns2_conntrack_-L_-o_extended + .../sos_commands/conntrack/ip_netns_exec_ns2_conntrack_-S + .../sos_commands/conntrack/ip_netns_exec_ns3_conntrack_-L_-o_extended + .../sos_commands/conntrack/ip_netns_exec_ns3_conntrack_-S + .../sos_commands/ebpf/ip_netns_exec_ns1_bpftool_net_list + .../sos_commands/ebpf/ip_netns_exec_ns2_bpftool_net_list + .../sos_commands/ebpf/ip_netns_exec_ns3_bpftool_net_list + ... + .../sos_commands/networking/ip_netns_exec_ns1_ip_address_show + ... + .../sos_commands/networking/ip_netns_exec_ns2_ip_address_show + ... + .../sos_commands/networking/ip_netns_exec_ns3_ip_address_show + ... +``` + +Signed-off-by: Mauricio Faria de Oliveira +Signed-off-by: Jake Hunsaker +--- + sos/report/plugins/conntrack.py | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/sos/report/plugins/conntrack.py b/sos/report/plugins/conntrack.py +index 80de3125a..be7e41d8d 100644 +--- a/sos/plugins/conntrack.py ++++ b/sos/plugins/conntrack.py +@@ -39,4 +39,22 @@ def setup(self): + "conntrack -S", + ]) + ++ # Capture additional data from namespaces; each command is run ++ # per-namespace ++ ip_netns = self.exec_cmd("ip netns") ++ cmd_prefix = "ip netns exec " ++ if ip_netns['status'] == 0: ++ out_ns = [] ++ for line in ip_netns['output'].splitlines(): ++ # If there's no namespaces, no need to continue ++ if line.startswith("Object \"netns\" is unknown") \ ++ or line.isspace() \ ++ or line[:1].isspace(): ++ continue ++ out_ns.append(line.partition(' ')[0]) ++ for namespace in out_ns: ++ ns_cmd_prefix = cmd_prefix + namespace + " " ++ self.add_cmd_output(ns_cmd_prefix + "conntrack -L -o extended") ++ self.add_cmd_output(ns_cmd_prefix + "conntrack -S") ++ + # vim: set et ts=4 sw=4 : diff -Nru sosreport-3.9.1/debian/patches/series sosreport-3.9.1/debian/patches/series --- sosreport-3.9.1/debian/patches/series 2020-07-07 19:34:35.000000000 +0000 +++ sosreport-3.9.1/debian/patches/series 2020-11-23 18:10:12.000000000 +0000 @@ -2,3 +2,5 @@ 0002-lds-substitute-oidc-conf.patch 0003-kvm-change-trigger-to-dev-kvm.patch 0004-maas-add-snap-support.patch +0005-conntrack-add-conntrack-info.patch +0006-conntrack-gather-per-namespace-data.patch