From bd4cf0970bba85ed434d043be8167db8d7424d89 Mon Sep 17 00:00:00 2001 From: Jake Hunsaker Date: Wed, 5 Dec 2018 16:31:41 -0500 Subject: [peripety] Add new plugin Adds a new plugin for the storage event monitoring daemon peripety. Resolves: #1502 Signed-off-by: Jake Hunsaker Signed-off-by: Bryn M. Reeves --- sos/plugins/peripety.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 sos/plugins/peripety.py 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 + +# 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 : -- cgit