aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2017-10-10 10:46:51 -0400
committerBryn M. Reeves <bmr@redhat.com>2017-11-15 16:53:51 +0000
commit19a42babee46387403f7a0ade68f3868d49151b4 (patch)
treeca3ed26806cb52eb3f35117d0c7c20887179f541
parent68e149809d5b487d0c5800b5a1a005aaad83c7be (diff)
downloadsos-19a42babee46387403f7a0ade68f3868d49151b4.tar.gz
[rear] Add new plugin
This adds a plugin for Relax and Recover, or rear, which is a backup and recovery tool. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Fixes: #1121 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/rear.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/sos/plugins/rear.py b/sos/plugins/rear.py
new file mode 100644
index 00000000..c70663c4
--- /dev/null
+++ b/sos/plugins/rear.py
@@ -0,0 +1,54 @@
+# Copyright (C) 2017 Red Hat, Inc. Jake Hunsaker <jhunsake@redhat.com>
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from sos.plugins import Plugin, RedHatPlugin
+
+
+class Rear(Plugin, RedHatPlugin):
+
+ """Relax and Recover
+ """
+
+ plugin_name = "rear"
+ packages = ('rear',)
+
+ def setup(self):
+ limit = self.get_option('log_size')
+
+ # don't collect recovery ISOs or tar archives
+ self.add_forbidden_path('/var/log/rear/*.iso')
+ self.add_forbidden_path('/var/log/rear/*.tar.gz')
+
+ rdirs = [
+ '/etc/rear/*conf',
+ '/var/log/rear/*log*'
+ ]
+
+ self.add_copy_spec(rdirs, sizelimit=limit)
+
+ self.add_cmd_output([
+ 'rear -V',
+ 'rear dump'
+ ])
+
+ def postproc(self):
+ self.do_path_regex_sub(
+ '/etc/rear/*',
+ r'SSH_ROOT_PASSWORD=(.*)',
+ r'SSH_ROOT_PASSWORD=********'
+ )
+
+# vim: set et ts=4 sw=4 :