diff options
author | Keith Robertson <kroberts@redhat.com> | 2012-08-14 11:34:01 -0700 |
---|---|---|
committer | Keith Robertson <kroberts@redhat.com> | 2012-08-14 11:34:01 -0700 |
commit | 76d22bab2fa74da4704111ad7054b72e7b342733 (patch) | |
tree | a413bc29a7addd3f40ad4528bace23947faf686c | |
parent | aff965fba822617e52e09deed7f80d5a39023b14 (diff) | |
parent | 88886641e70801e77c8d4841c9f3ff6b61c1c63e (diff) | |
download | sos-76d22bab2fa74da4704111ad7054b72e7b342733.tar.gz |
Merge pull request #58 from jds2001/master
Changes to networking plugin to support biosdevname. ACK
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | sos/plugins/networking.py | 19 |
2 files changed, 17 insertions, 5 deletions
@@ -10,3 +10,6 @@ dist-build/* sos/__init__.py cover/ .coverage +*.mo +sos.conf.5.gz +sosreport.1.gz diff --git a/sos/plugins/networking.py b/sos/plugins/networking.py index b0b3010c..c27c0b82 100644 --- a/sos/plugins/networking.py +++ b/sos/plugins/networking.py @@ -21,11 +21,16 @@ class networking(Plugin, RedHatPlugin): """ optionList = [("traceroute", "collects a traceroute to rhn.redhat.com", "slow", False)] - def get_interface_name(self,ifconfigFile): + 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. """ - out=self.doRegexFindAll(r"^(eth\d+)\D", ifconfigFile) + out={} + for line in ipaddrOut[1].splitlines(): + match=re.match('.*link/ether', line) + if match: + int=match.string.split(':')[1].lstrip() + out[int]=True return out def collectIPTable(self,tablename): @@ -51,7 +56,8 @@ class networking(Plugin, RedHatPlugin): "/etc/xinetd.d", "/etc/host*", "/etc/resolv.conf"]) - ifconfigFile=self.collectOutputNow("/sbin/ifconfig -a", root_symlink = "ifconfig") + ipaddrFile=self.collectOutputNow("/sbin/ip -o addr", root_symlink = "ip_addr") + ipaddrOut=self.callExtProg("/sbin/ip -o addr") self.collectExtOutput("/sbin/route -n", root_symlink = "route") self.collectIPTable("filter") self.collectIPTable("nat") @@ -66,11 +72,14 @@ class networking(Plugin, RedHatPlugin): self.collectExtOutput("/sbin/ifenslave -a") self.collectExtOutput("/sbin/ip mroute show") self.collectExtOutput("/sbin/ip maddr show") - if ifconfigFile: - for eth in self.get_interface_name(ifconfigFile): + if ipaddrOut: + for eth in self.get_interface_name(ipaddrOut): self.collectExtOutput("/sbin/ethtool "+eth) self.collectExtOutput("/sbin/ethtool -i "+eth) self.collectExtOutput("/sbin/ethtool -k "+eth) self.collectExtOutput("/sbin/ethtool -S "+eth) + self.collectExtOutput("/sbin/ethtool -a "+eth) + self.collectExtOutput("/sbin/ethtool -c "+eth) + self.collectExtOutput("/sbin/ethtool -g "+eth) if self.getOption("traceroute"): self.collectExtOutput("/bin/traceroute -n rhn.redhat.com") |