diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2018-12-05 16:31:41 -0500 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2019-03-19 17:55:05 +0000 |
commit | bd4cf0970bba85ed434d043be8167db8d7424d89 (patch) | |
tree | b67150903e4a95f5c1b249feebf14a1c9da8b84d | |
parent | c25e8b8033f06c5616b08e6852b72369be4c5795 (diff) | |
download | sos-bd4cf0970bba85ed434d043be8167db8d7424d89.tar.gz |
[peripety] Add new plugin
Adds a new plugin for the storage event monitoring daemon peripety.
Resolves: #1502
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/peripety.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sos/plugins/peripety.py b/sos/plugins/peripety.py new file mode 100644 index 00000000..7567731d --- /dev/null +++ b/sos/plugins/peripety.py @@ -0,0 +1,42 @@ +# Copyright (C) 2018 Red Hat, Inc., Jake Hunsaker <jhunsake@redhat.com> + +# This file is part of the sos project: https://github.com/sosreport/sos +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions of +# version 2 of the GNU General Public License. +# +# See the LICENSE file in the source distribution for further information. + +from sos.plugins import Plugin, RedHatPlugin +from re import match +import glob + + +class Peripety(Plugin, RedHatPlugin): + '''Peripety Storage Event Monitor''' + + packages = ('peripety',) + services = ('peripetyd',) + + def setup(self): + self.add_copy_spec('/etc/peripety.conf') + + forbid_reg = [ + 'vd.*', + 'sr.*', + 'loop.*', + 'ram.*' + ] + + disks = filter(lambda x: not any(match(reg, x) for reg in forbid_reg), + [d.split('/')[-1] for d in glob.glob('/sys/block/*')]) + + for disk in disks: + self.add_cmd_output([ + "prpt info %s" % disk, + "prpt query --blk %s" % disk + ]) + self.add_journal('peripetyd') + +# vim: set et ts=4 sw=4 : |