aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2018-04-03 09:47:06 +0200
committerBryn M. Reeves <bmr@redhat.com>2018-05-22 15:19:20 +0100
commit2d35d11fd767cf2ad525a46f5cb87e9697e760d4 (patch)
tree1007cd08b2cbe53bb0a7103b23183c884785b49a
parent4ba387ccb8a4033f87bcf0e133f097eac394d136 (diff)
downloadsos-2d35d11fd767cf2ad525a46f5cb87e9697e760d4.tar.gz
[networking] collect netstat for all namespaces
collect all netstat commands for all network namespaces Resolves: #1261 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/plugins/networking.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/sos/plugins/networking.py b/sos/plugins/networking.py
index ede4fbb9..16f589d8 100644
--- a/sos/plugins/networking.py
+++ b/sos/plugins/networking.py
@@ -243,11 +243,15 @@ class Networking(Plugin):
cmd_prefix = "ip netns exec "
if ip_netns_file:
for namespace in self.get_ip_netns(ip_netns_file):
+ ns_cmd_prefix = cmd_prefix + namespace + " "
self.add_cmd_output([
- cmd_prefix + namespace + " ip address show",
- cmd_prefix + namespace + " ip route show table all",
- cmd_prefix + namespace + " iptables-save",
- cmd_prefix + namespace + " ss -peaonmi"
+ ns_cmd_prefix + "ip address show",
+ ns_cmd_prefix + "ip route show table all",
+ ns_cmd_prefix + "iptables-save",
+ ns_cmd_prefix + "ss -peaonmi",
+ ns_cmd_prefix + "netstat %s -neopa" % self.ns_wide,
+ ns_cmd_prefix + "netstat -s",
+ ns_cmd_prefix + "netstat %s -agn" % self.ns_wide
])
# Devices that exist in a namespace use less ethtool