aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGermano Veit Michel <germano@redhat.com>2015-08-26 14:41:25 +1000
committerAdam Stokes <adam.stokes@ubuntu.com>2015-09-29 09:49:49 -0400
commit7998f368f59998205a57eff358f24af89daa8c99 (patch)
tree6b8c8be9b7ae3b387029a2733955027e759b186c
parent73e6537b1c8284edfb4919b28aa69ee82928c310 (diff)
downloadsos-7998f368f59998205a57eff358f24af89daa8c99.tar.gz
[networking] iptables: check module version and do ipv6
If we grep for "mangle", both ipv4 and ipv6 versions might come up. This patch ensure that the right version is considered. Also, do the same we do for ipv4, but for ipv6. Filter, Mangle, NAT and exact counters. Closes #630 Signed-off-by: Germano Veit Michel <germano@redhat.com> Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
-rw-r--r--sos/plugins/networking.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/sos/plugins/networking.py b/sos/plugins/networking.py
index c7ee76b5..eed4c293 100644
--- a/sos/plugins/networking.py
+++ b/sos/plugins/networking.py
@@ -63,10 +63,19 @@ class Networking(Plugin):
the command. If they aren't loaded, there can't possibly be any
relevant rules in that table """
- if self.check_ext_prog("grep -q %s /proc/modules" % tablename):
+ modname = "iptable_"+tablename
+ if self.check_ext_prog("grep -q %s /proc/modules" % modname):
cmd = "iptables -t "+tablename+" -nvL"
self.add_cmd_output(cmd)
+ def collect_ip6table(self, tablename):
+ """ Same as function above, but for ipv6 """
+
+ modname = "ip6table_"+tablename
+ if self.check_ext_prog("grep -q %s /proc/modules" % modname):
+ cmd = "ip6tables -t "+tablename+" -nvL"
+ self.add_cmd_output(cmd)
+
def setup(self):
super(Networking, self).setup()
self.add_copy_spec([
@@ -95,6 +104,9 @@ class Networking(Plugin):
self.collect_iptable("filter")
self.collect_iptable("nat")
self.collect_iptable("mangle")
+ self.collect_ip6table("filter")
+ self.collect_ip6table("nat")
+ self.collect_ip6table("mangle")
self.add_cmd_output("netstat -neopa", root_symlink="netstat")
self.add_cmd_output([
"netstat -s",
@@ -113,7 +125,8 @@ class Networking(Plugin):
"ip netns",
"biosdevname -d",
"tc -s qdisc show",
- "iptables -vnxL"
+ "iptables -vnxL",
+ "ip6tables -vnxL"
])
# There are some incompatible changes in nmcli since