RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1165878 - activemq plugin does not collect configuration files or logs
Summary: activemq plugin does not collect configuration files or logs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: sos
Version: 6.5
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Bryn M. Reeves
QA Contact: Miroslav Hradílek
URL:
Whiteboard:
Depends On:
Blocks: 1075802 1236111
TreeView+ depends on / blocked
 
Reported: 2014-11-19 23:04 UTC by Eric Rich
Modified: 2015-07-22 06:33 UTC (History)
9 users (show)

Fixed In Version: sos-3.2-18.el6
Doc Type: Bug Fix
Doc Text:
Does not require docs.
Clone Of:
: 1236111 (view as bug list)
Environment:
Last Closed: 2015-07-22 06:33:09 UTC
Target Upstream Version:
Embargoed:
mhradile: needinfo-


Attachments (Terms of Use)
amq sosreport (7.15 MB, application/x-xz)
2014-11-19 23:04 UTC, Eric Rich
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1323 0 normal SHIPPED_LIVE sos bug fix and enhancement update 2015-07-20 17:53:12 UTC

Description Eric Rich 2014-11-19 23:04:29 UTC
Created attachment 959203 [details]
amq sosreport

Description of problem:

The activemq plugin does not collect data on this server when deployed with openshift. 

See the attached report from a openshift broker support node.

Comment 2 Josep 'Pep' Turro Mauri 2014-12-23 19:00:05 UTC
About log collection: the upstream plugin uses self.files (which points to the logs). In the RHEL6 branch this class attribute is overriden by an instance [empty] deque attribute in PluginBase's init.

This should fix it for RHEL6:

diff --git a/sos/plugins/activemq.py b/sos/plugins/activemq.py
index f3bb63f..1c2c850 100644
--- a/sos/plugins/activemq.py
+++ b/sos/plugins/activemq.py
@@ -23,5 +23,5 @@ class activemq(sos.plugintools.PluginBase):
     files = ('/var/log/activemq',)
 
     def setup(self):
-        self.addCopySpecs(list(self.files))
+        self.addCopySpec('/var/log/activemq')
 

About configuration files: the upstream plugin is not collecting them. Submitted https://github.com/sosreport/sos/pull/457

Comment 3 Bryn M. Reeves 2015-01-08 11:38:49 UTC
Can we get a more restrictive path or glob than "/var/log/activemq"?

We're trying hard to avoid collecting whole directories from /var since it often ends badly (e.g. when very large new directories are added as has happened with RHEV and Gluster).

Comment 4 Eric Rich 2015-01-08 12:34:45 UTC
(In reply to Bryn M. Reeves from comment #3)
> Can we get a more restrictive path or glob than "/var/log/activemq"?
> 
> We're trying hard to avoid collecting whole directories from /var since it
> often ends badly (e.g. when very large new directories are added as has
> happened with RHEV and Gluster).

The directory contains, only the logs for activemq, and you end up looking at something like 11 files (give or take a few based on configuration), totaling roughly 112 MB (for the default configuration). 

activemq.log     activemq.log.1   activemq.log.10  activemq.log.2   activemq.log.3   activemq.log.4   activemq.log.5   activemq.log.6   activemq.log.7   activemq.log.8   activemq.log.9   wrapper.log

The server (service) defines the log location and the rolling configuration as the following (by default): 

# File appender
log4j.appender.logfile=org.apache.log4j.RollingFileAppender
log4j.appender.logfile.file=${activemq.base}/log/activemq.log
log4j.appender.logfile.maxFileSize=10240KB
log4j.appender.logfile.maxBackupIndex=10
log4j.appender.logfile.append=true
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%d | %-5p | %m | %c | %t%n

So depending on how this is set by a user, or how its defined you could better restrict the logs that are collected however I fell that would require that you read /etc/activemq/log4j.properties and get the location, and look a the maxBackupIndex to determin the proper regex to terminate the collection on.

- Note: ACTIVEMQ_BASE from /usr/share/activemq would also have to be read as the wrapper (start up script) is what defines, ${activemq.base} in the configuration above. 

/etc/activemq/wrapper.conf:wrapper.java.additional.2=-Dactivemq.base=%ACTIVEMQ_BASE%
/etc/activemq/wrapper.conf:wrapper.logfile=%ACTIVEMQ_BASE%/log/wrapper.log

Comment 5 Bryn M. Reeves 2015-01-08 18:58:56 UTC
> So depending on how this is set by a user,

That falls under the same rules as syslog/rsyslog configuration: we collect the default for the active policy and (optionally) provide a switch to enable parsing of the log configuration to collect additional/renamed logs.

Comment 6 Eric Rich 2015-01-08 20:43:04 UTC
(In reply to Bryn M. Reeves from comment #5)
> > So depending on how this is set by a user,
> 
> That falls under the same rules as syslog/rsyslog configuration: we collect
> the default for the active policy and (optionally) provide a switch to
> enable parsing of the log configuration to collect additional/renamed logs.

That's fine, my main point for point out the configuration and the files above was to give you the information you need, to limit the file collection as well as provide the optionally switch to read the configuration (should we choose), and get all the files.

Comment 7 Josep 'Pep' Turro Mauri 2015-01-09 18:31:47 UTC
(In reply to Bryn M. Reeves from comment #3)
> Can we get a more restrictive path or glob than "/var/log/activemq"?
> 
> We're trying hard to avoid collecting whole directories from /var since it
> often ends badly (e.g. when very large new directories are added as has
> happened with RHEV and Gluster).

Right. As the patch in comment #2 was meant to just fix the log collection in the rhel6 branch it didn't do anything around restricting the files to collect, just keeping what upstream and the current version of the plugin had.

I've amended upstream PR 457 to use the all_logs option as per comment #5. I didn't implement the improvements suggested in comment #4 though, just kept the default hardcoded.

Comment 17 Bryn M. Reeves 2015-06-03 14:32:53 UTC
Can someone post the relevant part of /usr/share/activemq/examples/conf/activemq-security.xml?

Comment 20 Josep 'Pep' Turro Mauri 2015-06-03 17:13:53 UTC
The activemq sos plugin was created as a spin-off of the openshift plugin and so far it's capturing/processing data from activemq used from an openshift perspective.

Unfortunately I'm not familiar enough with "standalone" activemq and its usage outside of the context of openshift to suggest additional data to collect and process.

A 'grep -i password' in the examples/conf dir shows various ways to specify passords via attributes:

       password="password"
       trustStorePassword="password"
       zkPassword="password"
       keyStorePassword="password"
       <property name="password" value="activemq"/>

Openshift installations only use the first one in /etc/activemq/activemq.xml, which is the (only) file that the plugin currently collects, and the plugin obfuscates that (i.e. the authenticationUser tags).

Here's the parof the installer script that creates that file:

  https://github.com/openshift/openshift-extras/blob/enterprise-2.2/enterprise/install-scripts/generic/openshift.sh#L2687

it doesn't set any property with passwords.

Probably worth opening separate bug(s) to collect and process additional files used in general activemq usage, but for the openshift use case it should be fine with the fix so far.

Comment 21 Bryn M. Reeves 2015-06-04 09:08:03 UTC
These attributes are easy enough to create substitution rules for. Given our main use is currently OpenShift I am not that concerned about this however it is something that we need to address when possible as users may be deploying ActiveMQ on their RHEL hosts for their own purposes.

Comment 22 Miroslav Hradílek 2015-06-04 10:42:38 UTC
Thanks guys for the clarification. I don't think we are shipping activemq outside openshift so I think it is safe to leave this as is for now.

Comment 23 Bryn M. Reeves 2015-06-04 11:19:53 UTC
I believe it is also available via some middleware products so it is certainly something we need to address.

Comment 24 Bryn M. Reeves 2015-06-04 11:20:39 UTC
cf. https://access.redhat.com/articles/310613

Comment 25 Bryn M. Reeves 2015-06-04 12:32:06 UTC
OK: I've spoken to our JBoss support team and I think we can go ahead as-is for 6.7.

The reason for this is that JBoss-AMQ and the ActiveMQ packages for JBoss customers are deployed as a ZIP archive. This means that they will not meet the trigger for the current sos activemq plugin (requires RPM packages named 'activemq' or 'activemq-core').

Since we do not use the activemq security attributes in OpenShift and since JBoss deployments of AMQ will not use RPM packaging we are safe to ship 6.7 without a postproc method for these patterns.

We should obviously still follow up with this upstream and in future updates but for now there appears to be very limited risk for the current approach.

Comment 26 errata-xmlrpc 2015-07-22 06:33:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1323.html


Note You need to log in before you can comment on or make changes to this bug.