diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2018-02-10 13:32:21 -0500 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2018-04-30 14:04:45 +0100 |
commit | 6781bab5215d7fe086b51e8a5ae901481ec48f5e (patch) | |
tree | d6d9396c31866ff17029d0cb4aafae614b260506 | |
parent | 61a8968627f66b5777dd04f348df525685ba1fa1 (diff) | |
download | sos-6781bab5215d7fe086b51e8a5ae901481ec48f5e.tar.gz |
[filesys] Clean lsof output, capture lslocks and mountinfo for pids
Cleans the output of lsof, removing errors and warnings that are
expected due to the lsof command that is being run. Other errors that
lsof might produce to stderr are still preserved.
Additionally, capture lslocks output and /proc/pid/mountinfo for each
pid.
Resolves: #1212
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/filesys.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sos/plugins/filesys.py b/sos/plugins/filesys.py index 75beb5a1..d14d1976 100644 --- a/sos/plugins/filesys.py +++ b/sos/plugins/filesys.py @@ -36,13 +36,15 @@ class Filesys(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): "/proc/self/mounts", "/proc/self/mountinfo", "/proc/self/mountstats", - "/etc/fstab", + "/proc/[0-9]*/mountinfo", + "/etc/fstab" ]) self.add_cmd_output("mount -l", root_symlink="mount") self.add_cmd_output("df -al -x autofs", root_symlink="df") self.add_cmd_output([ "df -ali -x autofs", - "findmnt" + "findmnt", + "lslocks" ]) if self.get_option('lsof'): @@ -66,4 +68,11 @@ class Filesys(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): r"\1********" ) + # remove expected errors from lsof due to command formatting, but still + # keep stderr so other errors are reported + regex = (r"(lsof: (avoiding (.*?)|WARNING: can't stat\(\) (.*?))|" + "Output information may be incomplete.)\n") + + self.do_cmd_output_sub("lsof", regex, '') + # vim: set et ts=4 sw=4 : |