aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPep Turró Mauri <pep@redhat.com>2014-12-23 19:36:29 +0100
committerBryn M. Reeves <bmr@redhat.com>2015-03-09 16:53:12 +0000
commite2a94de2e574b61d1da071f961863d2490c90bc0 (patch)
tree02e1d3f4c51fed7627de7e9318ceefd23aca26f5
parentf94d286fea0206e9697fb841b6ab955bc2bf1472 (diff)
downloadsos-e2a94de2e574b61d1da071f961863d2490c90bc0.tar.gz
[activemq] Honour all_logs and get config on RHEL
Get only current log file by default, allowing full dir collection via the all_logs option. Add a Red Hat version of the plugin that collects the two main configuration files for activemq. Also enable that plugin in the OpenShift profile. Related: RHBZ#1165878 Fixes: #457. Signed-off-by: Pep Turró Mauri <pep@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/activemq.py31
1 files changed, 28 insertions, 3 deletions
diff --git a/sos/plugins/activemq.py b/sos/plugins/activemq.py
index 291fcd9a..15942293 100644
--- a/sos/plugins/activemq.py
+++ b/sos/plugins/activemq.py
@@ -16,17 +16,42 @@
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
-class ActiveMq(Plugin, RedHatPlugin, DebianPlugin):
+class ActiveMq(Plugin, DebianPlugin):
"""ActiveMQ message broker
"""
plugin_name = 'activemq'
- profiles = ()
+ profiles = ('openshift',)
packages = ('activemq', 'activemq-core')
files = ('/var/log/activemq',)
def setup(self):
- self.add_copy_spec(list(self.files))
+ if self.get_option("all_logs"):
+ self.add_copy_spec(list(self.files))
+ else:
+ self.add_copy_spec([
+ "/var/log/activemq/activemq.log",
+ "/var/log/activemq/wrapper.log"
+ ])
+
+ def postproc(self):
+ # activemq.xml contains credentials in this form:
+ # <authenticationUser ... password="changeme" ... />
+ self.do_file_sub(
+ '/etc/activemq/activemq.xml',
+ r'(\s*password=")[^"]*(".*)',
+ r"\1******\2"
+ )
+
+
+class RedHatActiveMq(ActiveMq, RedHatPlugin):
+
+ def setup(self):
+ super(RedHatActiveMq, self).setup()
+ self.add_copy_spec([
+ '/etc/sysconfig/activemq',
+ '/etc/activemq/activemq.xml'
+ ])
class UbuntuActiveMq(ActiveMq, UbuntuPlugin):