From c8a5039053cb6bc13518e0b249f37de290d317a7 Mon Sep 17 00:00:00 2001 From: Adrien Mahieux Date: Tue, 18 Apr 2017 14:38:08 +0200 Subject: [filesys] Add reporting of ext fragmentation with e2freefrag Fixes: #992 Signed-off-by: Adrien Mahieux Signed-off-by: Bryn M. Reeves --- sos/plugins/filesys.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sos/plugins/filesys.py b/sos/plugins/filesys.py index c48293ab..53ca17e1 100644 --- a/sos/plugins/filesys.py +++ b/sos/plugins/filesys.py @@ -22,9 +22,11 @@ class Filesys(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): plugin_name = 'filesys' profiles = ('storage',) - option_list = [("lsof", 'gathers information on all open files', 'slow', - False), - ("dumpe2fs", 'dump filesystem information', 'slow', False)] + option_list = [ + ("lsof", 'gathers information on all open files', 'slow', False), + ("dumpe2fs", 'dump filesystem information', 'slow', False), + ("frag", 'filesystem fragmentation status', 'slow', False) + ] def setup(self): self.add_copy_spec([ @@ -53,6 +55,9 @@ class Filesys(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): for dev in self.do_regex_find_all(ext_fs_regex, mounts): self.add_cmd_output("dumpe2fs %s %s" % (dumpe2fs_opts, dev)) + if self.get_option('frag'): + self.add_cmd_output("e2freefrag %s" % (dev)) + def postproc(self): self.do_file_sub( "/etc/fstab", -- cgit