From d90c3b862dfc26578afe5198bf19d70c394d9951 Mon Sep 17 00:00:00 2001 From: Jan Jansky Date: Mon, 18 May 2020 12:32:14 +0200 Subject: [PATCH] [redis] Collection of redis from scl As preparation for Satellite 7 configuration and log collection adding collection of rh-redis32 from scl. Resolves: #2074 Signed-off-by: Jan Jansky --- sos/plugins/redis.py | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/sos/plugins/redis.py b/sos/plugins/redis.py index 36d9052..0f01c4e 100644 --- a/sos/plugins/redis.py +++ b/sos/plugins/redis.py @@ -9,17 +9,17 @@ # # See the LICENSE file in the source distribution for further information. -from sos.plugins import Plugin, RedHatPlugin +from sos.plugins import Plugin, SCLPlugin -class Redis(Plugin, RedHatPlugin): +class Redis(Plugin, SCLPlugin): """Redis, in-memory data structure store """ plugin_name = 'redis' profiles = ('services',) - packages = ('redis',) + packages = ('redis', 'rh-redis32', 'rh-redis5') var_puppet_gen = "/var/lib/config-data/puppet-generated/redis" files = ( '/etc/redis.conf', @@ -35,6 +35,17 @@ class Redis(Plugin, RedHatPlugin): self.var_puppet_gen + "/etc/security/limits.d/" ]) + for pkg in self.packages[1:]: + scl = pkg.split('rh-redis*-')[0] + self.add_copy_spec_scl(scl, [ + '/etc/redis.conf', + '/etc/redis.conf.puppet', + '/etc/redis-sentinel.conf', + '/etc/redis-sentinel.conf.puppet', + '/var/log/redis/sentinel.log', + '/var/log/redis/redis.log' + ]) + self.add_cmd_output("redis-cli info") if self.get_option("all_logs"): self.add_copy_spec([ @@ -46,26 +57,19 @@ class Redis(Plugin, RedHatPlugin): ]) def postproc(self): - self.do_file_sub( - "/etc/redis.conf", - r"(masterauth\s).*", - r"\1********" - ) - self.do_file_sub( - "/etc/redis.conf", - r"(requirepass\s).*", - r"\1********" - ) - self.do_path_regex_sub( - self.var_puppet_gen + "/etc/redis.conf*", - r"(masterauth\s).*", - r"\1*********" - ) - self.do_path_regex_sub( - self.var_puppet_gen + "/etc/redis.conf*", - r"(requirepass\s).*", - r"\1*********" - ) - + for path in ["/etc/", + self.var_puppet_gen + "/etc/", + "/etc/opt/rh/rh-redis32/", + "/etc/opt/rh/rh-redis5/"]: + self.do_file_sub( + path + "redis.conf", + r"(masterauth\s).*", + r"\1********" + ) + self.do_file_sub( + path + "redis.conf", + r"(requirepass\s).*", + r"requirepass = ********" + ) # vim: set et ts=4 sw=4 : -- 1.8.3.1