aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2011-08-15 09:00:00 +0100
committerBryn M. Reeves <bmr@redhat.com>2011-08-15 09:00:00 +0100
commit244cb47703180f4842376a78c410462d4f45c6f0 (patch)
tree2b03786d00fdbe3614546a27d5a65f0b80373acd
parent1110a96d0461657f133736697cc188b9627911f5 (diff)
downloadsos-244cb47703180f4842376a78c410462d4f45c6f0.tar.gz
Collect brctl show and showstp output
-rw-r--r--sos/plugins/networking.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/sos/plugins/networking.py b/sos/plugins/networking.py
index 2f1c58ea..b18e7896 100644
--- a/sos/plugins/networking.py
+++ b/sos/plugins/networking.py
@@ -21,6 +21,20 @@ class networking(sos.plugintools.PluginBase):
"""
optionList = [("traceroute", "collects a traceroute to rhn.redhat.com", "slow", False)]
+ def get_bridge_name(self,brctlFile):
+ """Return a dictionary for which key are bridge name according to the
+ output of brctl show stored in brctlFile.
+ """
+ out=[]
+ fp = open(brctlFile, 'r')
+ for line in fp.readlines():
+ if line.startswith("bridge name") or line.isspace():
+ continue
+ brName, brRest = line.split(None, 1)
+ out.append(brName)
+ fp.close()
+ return out
+
def get_interface_name(self,ifconfigFile):
"""Return a dictionary for which key are interface name according to the
output of ifconifg-a stored in ifconfigFile.
@@ -78,6 +92,10 @@ class networking(sos.plugintools.PluginBase):
self.collectExtOutput("/sbin/ethtool -g "+eth)
if self.getOption("traceroute"):
self.collectExtOutput("/bin/traceroute -n rhn.redhat.com")
-
+ if os.path.exists("/usr/sbin/brctl"):
+ brctlFile=self.collectOutputNow("/usr/sbin/brctl show")
+ if brctlFile:
+ for brName in self.get_bridge_name(brctlFile):
+ self.collectExtOutput("/usr/sbin/brctl showstp "+brName)
return