Red Hat Bugzilla – Bug 785026
Event logging is broken with no feedback to the user if native support is disabled
Last modified: 2015-02-01 18:27:34 EST
Description of problem:
If event logging is enabled but native support is disabled, events do not get processed.
A pure Java alternative should be provided in cases where native support is unavailable or the user should be warned that although event logging is enabled for a resource, it will not be active due to native support being disabled.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Enable event logging for an AS resource or RHQ Agent
2. Confirm events are being logged
3. Restart agent with the --nonative command-line option
No events are logged once the agent is started with --nonative and the agent log contains no information indicating that event logging is failing
Event logging should continue to work
Ian's response from rhq-devel https://fedorahosted.org/pipermail/rhq-devel/2012-January/001434.html confirms this issue exists and suggests that it might be possible to implement a pure Java option.
Raising the sev on this to medium. We really should be logging a warning. It would also be nice if we threw an exception in the plugins if a user tried to enable log events when native support is disabled in the Agent.
But I think getting log events to work w/out SIGAR is low priority, since we support SIGAR on all the major platforms.
per 12/30/2012 BZ triage meeting mfoley, ccrouch, loleary, asantos
we are splitting this BZ into 2 ...
1) we are reducing the scope of this BZ. providing customer feedback *is* the new reduced scope of this BZ ... and this is being targetted for 3.01.
2) i will be cloning a 2nd BZ as an RFE for the pure java alternative
the RFE for the pure java alternative to Sigar is --->>> https://bugzilla.redhat.com/show_bug.cgi?id=785802
Switching to using MODIFIED for fixes that are in the appropriate but are waiting to get into a build.
This is now also fixed in master - http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=5b7557b.
QE, you can test this as follows:
1) Enable a log event source in the connection settings of some AS server Resource - easiest is to enabled rhq-server.log event source for the RHQ Server resource. Save the conn settings.
2) Stop the Agent on the same box as the AS server above, then restart the Agent with the -t option (which disables SIGAR).
3) Verify that within a few minutes the Agent logs a warning similar to this:
2012-01-31 12:07:11,193 WARN [ResourceContainer.invoker.daemon-1] (core.pluginapi.event.log.LogFileEventResourceComponentHelper)- Log files [/home/ips/Projects/rhq/dev-container/logs/rhq-server-log4j.log] for [JBossAS:JBossAS Server] Resource with key [/home/ips/Projects/rhq/dev-container/jbossas/server/default] cannot be polled, because log file polling requires RHQ native support, which has been disabled for this Agent.
Also verify that there are no errors in the Agent log file related to log file event polling.
Moving to ON_QA as there is a new binary 3.0.1.GA RC2 available here to test with:
attaching agent log to document my verification. my observations:
1) line #1 shows the agent started with -t ... no native libraries
2) over the course of 6 minutes ... i do not see the WARN message as expected in step#3 of the verification process.
this doesn't seem to be the expected behavior in RC2.
Created attachment 559365 [details]
agent log ... (which does not show the WARN as expected)
the 1st line of the agent file confirms the agent restart with -2
but i don't see the expected WARN statement.
I just verified this using the recent build of RHQ 3.0.1 running on an internal Beaker box. After enabling log events on my RHQ Server Resource and restarting the Agent with -t, I saw the following message in the Agent log:
2012-02-13 23:09:13,419 WARN [ResourceContainer.invoker.daemon-1] (core.pluginapi.event.log.LogFileEventResourceComponentHelper)- Log files [/usr/share/jboss-on-3.0.1.GA/server/logs/rhq-server-log4j.log] for [JBossAS:JBossAS Server] Resource with key [/usr/share/jboss-on-3.0.1.GA/server/jbossas/server/default] cannot be polled, because log file polling requires RHQ native support, which has been disabled for this Agent.
Mike, perhaps you forgot to do step 1) from the test steps I provided in comment 7?
Verified on Version: 3.0.1.GA RC4 (Build Number: dd8a001:c5270fb)
Enabled event log RHQ Server Resource and confirmed that events are logged in 'Events->History' tab of the resource. Restarted the agent with -t option. After few minutes, the agent log displays below:
2012-02-14 12:36:55,786 WARN [ResourceContainer.invoker.daemon-1] (core.pluginapi.event.log.LogFileEventResourceComponentHelper)- Log files [/install/jonbuilds/jon301garc4/jon-server-3.0.1.GA/logs/rhq-server-log4j.log] for [JBossAS:JBossAS Server] Resource with key [/install/jonbuilds/jon301garc4/jon-server-3.0.1.GA/jbossas/server/default] cannot be polled, because log file polling requires RHQ native support, which has been disabled for this Agent.
There are no errors related to log file event polling.
Bulk closing of old issues in VERIFIED state.