From 7998f368f59998205a57eff358f24af89daa8c99 Mon Sep 17 00:00:00 2001 From: Germano Veit Michel Date: Wed, 26 Aug 2015 14:41:25 +1000 Subject: [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 Signed-off-by: Adam Stokes --- sos/plugins/networking.py | 17 +++++++++++++++-- 1 file 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 -- cgit