13178ca5fa
This synchronises sos in master to the current upstream sos-2.2 branch and includes all patches from RHEL6 not already present.
37 lines
1.6 KiB
Diff
37 lines
1.6 KiB
Diff
diff -up sos-2.2/sos/plugins/networking.py.orig sos-2.2/sos/plugins/networking.py
|
|
--- sos-2.2/sos/plugins/networking.py.orig 2011-08-15 01:44:30.290816400 +0100
|
|
+++ sos-2.2/sos/plugins/networking.py 2011-08-15 02:03:36.814212707 +0100
|
|
@@ -21,6 +21,20 @@ class networking(sos.plugintools.PluginB
|
|
"""
|
|
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.
|
|
@@ -77,6 +91,10 @@ class networking(sos.plugintools.PluginB
|
|
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
|
|
|