Skip to content

Commit

Permalink
[networking] collect netstat for all namespaces
Browse files Browse the repository at this point in the history
collect all netstat commands for all network namespaces

Resolves: #1261

Signed-off-by: Pavel Moravec <[email protected]>
  • Loading branch information
pmoravec authored and bmr-cymru committed May 22, 2018
1 parent 4ba387c commit 2d35d11
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sos/plugins/networking.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,15 @@ def setup(self):
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
Expand Down

0 comments on commit 2d35d11

Please sign in to comment.