aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2011-08-15 09:05:00 +0100
committerBryn M. Reeves <bmr@redhat.com>2012-11-29 22:25:33 +0000
commit77bde527d18fee1261e497e08527ec164d67bbb4 (patch)
tree0afc491c8fb6de09b30a66cc8404bfd6754a118e
parentfd165e876bfb11a91aa05dd3bb87f263f1aa667d (diff)
downloadsos-77bde527d18fee1261e497e08527ec164d67bbb4.tar.gz
Collect brctl show and showstp output
-rw-r--r--sos/plugins/networking.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/sos/plugins/networking.py b/sos/plugins/networking.py
index 7ff1d72e..7225e8b6 100644
--- a/sos/plugins/networking.py
+++ b/sos/plugins/networking.py
@@ -21,6 +21,20 @@ class networking(Plugin, RedHatPlugin):
"""
optionList = [("traceroute", "collects a traceroute to rhn.redhat.com", "slow", False)]
+ def get_bridge_name(self,brctlOut):
+ """Return a list for which items are bridge name according to the
+ output of brctl show stored in brctlFile.
+ """
+ out=[]
+ for line in brctlOut[1].splitlines():
+ if line.startswith("bridge name") \
+ or line.isspace() \
+ or line[:1].isspace():
+ continue
+ brName, brRest = line.split(None, 1)
+ out.append(brName)
+ return out
+
def get_interface_name(self,ipaddrOut):
"""Return a dictionary for which key are interface name according to the
output of ifconifg-a stored in ifconfigFile.
@@ -84,3 +98,12 @@ class networking(Plugin, RedHatPlugin):
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.collectExtOutput("/usr/sbin/brctl show")
+ brctlOut=self.callExtProg("/usr/sbin/brctl show")
+ if brctlOut:
+ for brName in self.get_bridge_name(brctlOut):
+ self.collectExtOutput("/usr/sbin/brctl showstp "+brName)
+ return
+