From 168b7c226cd17fa75eecc0e6ce4c81d001747f78 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 7 May 2015 08:57:28 -0400 Subject: [PATCH] dump iptables in the worlddump If we fail during devstack / grenade runs, it would be nice to have the map of iptables that are currently active as well. This makes it handy to start figuring out what's going on when test servers don't ping. Change-Id: Ia31736ef2cb0221586d30c089473dfdc1db90e23 --- tools/worlddump.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/worlddump.py b/tools/worlddump.py index 8dd455c274..cb32510526 100755 --- a/tools/worlddump.py +++ b/tools/worlddump.py @@ -61,6 +61,17 @@ File System Summary print dfraw +def iptables_dump(): + tables = ['filter', 'nat', 'mangle'] + print """ +IP Tables Dump +=============== +""" + for table in tables: + print os.popen("sudo iptables --line-numbers -L -nv -t %s" + % table).read() + + def process_list(): print """ Process Listing @@ -79,6 +90,7 @@ def main(): os.dup2(f.fileno(), sys.stdout.fileno()) disk_space() process_list() + iptables_dump() if __name__ == '__main__':