Need advice about agent plugin design
by Steven North
I am trying to design an RHQ/JON agent plugin to manage a software
resource with the following characteristics:
- there is the software itself (the installation);
- there are a variable number of "bundles" of configuration information
about 250KB in size each which need to be read from and written to the
agent; and
- there are "log" files which can 10-50MB in size each which need to be
read from the agent.
I think I am pretty clear on how to handle the software itself--just
like any number of other agents.
I am not sure how to handle the configuration bundles and the large log
files.
We might want to have the RHQ/JON server manage different versions of
these configuration files and distribute them to multiple remote agents.
Is there some existing domain object that would handle the read/write
aspect of the configuration bundles (zip files)? Could the "package"
concept be used for these? Would we need to create a new domain object
on the server side for these bundles? If so, is there an example of
this kind of thing?
For the log files, I see some mention of the SupportFacet. Would this
be appropriate for retrieving large log files? Is there an example of this?
We expect to access the configuration bundles and the log files using
remote client operations because we have a separate GUI tool to
build/edit the configuration bundles and to correlate and analyze the
log files. Is there an example of using a remote client to pull files
from and push files to remote agents?
Thanks in advance for any advice you can give or examples you can point to.
Steve
10 years, 1 month
RHQ & mockito
by Stefan Negrea
Hello Everybody,
I've done some recent research into mocking frameworks for use with RHQ tests. Out of all the frameworks I stumbled upon, mockito looked the best (http://code.google.com/p/mockito/).
Here are some features that set mockito apart:
- fluid interfaces
- concise api
- very good documentation (eg: http://docs.mockito.googlecode.com/hg/latest/org/mockito/Mockito.html)
- vibrant & active community
- good maven integration, updates promptly published to maven repos
I know that jMock was used in some parts of RHQ however I find mockito superior especially around argument matchers, number of invocations, and call order. Please take a look at this blog post for a detailed comparison: http://www.zsoltfabok.com/blog/2010/08/jmock-versus-mockito/
I started this research in order to improve test coverage for the content system. My plan is to give mockito a try in that context and if successful apply it more broadly.
Any feedback or ideas are more than welcome.
Thank you,
Stefan Negrea
Software Engineer
12 years, 2 months
Event logging and native support
by Larry O'Leary
I have not looked through the code so please forgive me if this is an
easy one. Currently, it would appear that if native support is disabled
in the agent, event logging does not occur. Is this expected? Why is
native support required for parsing event logs?
This appears to be related to
https://bugzilla.redhat.com/show_bug.cgi?id=773435 however in my use
case native support is actually being disabled by using the --nonative
command-line option when starting the agent. As long as this option is
not used, event logging appears to be working as normal but if I start
the agent with --nonative, even logging no longer occurs and new events
do not show up in the Events >> History page.
--
Larry O'Leary
https://plus.google.com/u/0/112645929986009801513
12 years, 3 months
AUTO: David A. Webster is out of the office (returning 02/03/2012)
by David A. Webster
I am out of the office until 02/03/2012.
Out on vacation, returning Friday, Feb 3
Note: This is an automated response to your message "Re: [BZ 703557] jmx
plugin: auto-discover JVMs not exposed via JMX Remoting" sent on
1/25/2012 5:49:45 PM.
This is the only notification you will receive while this person is away.
**
This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies.
**
12 years, 3 months
[BZ 703557] jmx plugin: auto-discover JVMs not exposed via JMX Remoting
by Ian Springer
The jmx plugin is currently only able to auto-discover JVMs that expose
JMX Remoting. However, it is possible to discover and manage other JVMs
using the Sun Attach API, with a couple conditions:
1) a Sun JDK (not JRE) or another JDK whose tools.jar contains the Sun
Attach API (com.sun.tools.attach.*) classes (IcedTea?) is available on
the Agent box
2) the user the Agent is running as has permission to connect to the JVM
processes using IPC - typically this means either the Agent is running
as the same user the JVM is running as, or the Agent is running as root
Even considering these conditions, enhancing the jmx plugin to support
discovering and managing non-JMX-remoted JVMs would be a useful feature
that many RHQ users could take advantage of.
I have begun implementing this feature using the patch a community
member attached to 703557 as a starting point. It is coming along well,
but there have been a few technical challenges:
1) if the Agent is not running on a Sun, or Sun compatible, JDK (not
JRE), then the tools.jar containing the Sun Attach APIs will not be
available, and we cannot bundle the tools.jar with the Agent or the jmx
plugin, because Sun/Oracle's license does not permit it; therefore, my
plan is to include tools.jar from the Agent's JDK in the plugin
container classloader if possible, and if not to log an informative
warning, e.g. "The Oracle/Sun JDK tools.jar could not be added to the
plugin container classloader. Plugin functionality that requires classes
from tools.jar will not be available."
2) I started out trying to load tools.jar into a URLClassLoader created
by the jmx plugin as needed, but apparently tools.jar can only be loaded
into a single classloader in the Agent JVM, since it makes use of native
shared libraries, which cannot be accessed from multiple classloaders;
so I am instead going to include tools.jar in the plugin container
classloader, where it will be loaded a single time if it's available,
and then can be used by the jmx plugin or other plugins; again, we
cannot bundle the tools.jar with the jmx plugin due to licensing
restrictions, and we cannot include it in a connection/Resource
classloader, since there would be one of those per JVM Resource
3) the pid cannot be used as the JVM Resource's Resource key, since it
will change after the JVM is restarted, the attach API local connector
address for the JVM also cannot be used, since that will also change
after a JVM restart. since we are really only interested in monitoring
long-running "server" JVMs, I think a good choice for the Resource key
is the set of network addresses the JVM is listening on (e.g.
"[tcp:0.0.0.0:8080,tcp:0.0.0.0:8443]"), since this is not something that
will typically change for a given server JVM; the patch from the
community member looked for the Java system property "app.name" on the
JVM command line and used that as the Resource key; I didn't go with
that approach since it requires updating a server's command arguments
and restarting it in order for RHQ to be able to discover it; I'm
interested in any other ideas people have for the Resource key
Thanks for any feedback.
--Ian
12 years, 3 months
hbase presentation
by John Sanda
Earlier in the week I attended a really presentation on HBase at a local
Hadoop user group. For anyone interested you can view the slides at
http://www.slideshare.net/trihug/intro-to-apache-hbase-by-chris-shain-of-....
For those not familiar, HBase is a semi-structured, column-oriented
database, though nothing like a database in the traditional sense. HBase
does not have transactions, indexes, etc. like you find with an RDBMS.
HBase is particularly well suited for time series data and write
intensive applications. It is something to think about for metrics and
event logging.
- John
12 years, 3 months
compile error in server-jar (on HEAD of master branch)
by Ian Springer
Anyone know what this is? I've been getting it for at least a few days now.
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR]
/home/ips/Projects/rhq/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SessionManager.java:[29,19]
package org.rhq.jndi does not exist
[ERROR]
/home/ips/Projects/rhq/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SessionManager.java:[48,25]
cannot find symbol
symbol : class AllowRhqServerInternalsAccessPermission
location: class org.rhq.enterprise.server.auth.SessionManager
[ERROR]
/home/ips/Projects/rhq/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SessionManager.java:[48,89]
cannot find symbol
symbol : class AllowRhqServerInternalsAccessPermission
location: class org.rhq.enterprise.server.auth.SessionManager
[INFO] 3 errors
[INFO] -------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Compilation failure
/home/ips/Projects/rhq/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SessionManager.java:[29,19]
package org.rhq.jndi does not exist
/home/ips/Projects/rhq/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SessionManager.java:[48,25]
cannot find symbol
symbol : class AllowRhqServerInternalsAccessPermission
location: class org.rhq.enterprise.server.auth.SessionManager
/home/ips/Projects/rhq/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SessionManager.java:[48,89]
cannot find symbol
symbol : class AllowRhqServerInternalsAccessPermission
location: class org.rhq.enterprise.server.auth.SessionManager
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
Thanks,
Ian
12 years, 3 months