On 01/28/10 08:08, Bryan Kearney wrote:
> On 01/27/2010 09:15 PM, Adam Young wrote:
>> Here are the current set of values for token replacement. I'm willing
>> to modify them based on feedback.
>>
>> All of the following tokens start with "rhq.system."
>>
>> hostname
>> os.name
>> os.version
>> os.type
>> cpu.count
>> architecture
>>
>> For network adapters the key will start with "rhq.system.interfaces."
>> followed by the network adapter name; i.e. eth0
>>
>> .mac
>> .type
>> .flags
>>
>> The way that system info is set up right now, there is a list of IP
>> addresses associated with the network adapter. For now, I will pull out
>> the first one and assume it is the only one, but this is probably not
>> the right solution. The same goes for multicast.
>> .address
>> .multicast.address
>
>
> Looking at the satellite macros, I see the following missing. Some may
> be satellite specific tho..
>
> • rhn.system.sid
> • rhn.system.profile_name
> • rhn.system.description
> • rhn.system.net_interface.netmask(eth_device)
> • rhn.system.net_interface.driver_module(eth_device)
>
>
> Did we bail on doing traits? Or, are all the traits on the platform
> from here?
So far I have not attempted to use traits, as they are not currently
available from the agent. However, I don't think traits solves these
problems anyway. If they do, I'll attack them again.
These are the values on the overiview page for the platform: (Sorry
about the html)
Type: Linux (Platform) Description: Linux Operating System
Version: Linux 2.6.30.9-96.fc11.x86_64 Parent: none
Hostname: ayoung.boston.devel.redhat.com Architecture: x86_64
OS Name: Linux Distribution Name: Fedora
OS Version: 2.6.30.9-96.fc11.x86_64 Distribution Version: release 11
(Leonidas)
These all come from the systeminfo object. Description is, I think,
reusing one of the other fields, like OsType or OsName.
at the sysinfo level, the netmask and driver_module are not avaialable.
The same information is available on the website, so I don't think we
have that information yet. Inet4Address is, I think, an enumeration of
the values stored under the network adapters unicast address list. For
Linux systems, there is only one IPv4 Address, although there can be
many IPv6 ones, which may be an issue in the future.
>
>
>
>>
>>
>> In order to use the templating engine, call:
>> org.rhq.core.system.SystemInfoFactory.fetchTemplateEngine. I partnered
>> this with the SystemInfoFacotry since that was bascially the major
>> dependecy for getting this to work. Again, I am not wedded to that, but
>> it seems the cleanest place to put it.
>>
>> And example of using it is checked in to the ConfigurationManager:
>>
>> TemplateEngine templateEngine = SystemInfoFactory.fetchTemplateEngine();
>>
>> ...
>> for (RawConfiguration rawConfig :
>> configuration.getRawConfigurations()) {
>> String contents = templateEngine.replaceTokens(new
>> String(rawConfig.getContents()));
>> ....
>>
>>
>>
>
> Can I add to the list above with new tokesn?
Are you asking for dynamic tokens? I have not implemented that yet.
There was some question as to whether we needed it or not. Do we?
>
> -- bk
[sending this to rhq-users mailing list - its more appropriate there]
> I have tried to do it with the agent-configuration.xml in the
> agent/conf directory but it doesn't seem to have made it any faster.
Read the comments at the very top of agent-configuration.xml -
specifically where it talks about changing this file and how it isn't
always picked up since the config file is not where the persisted config
is stored.
Also read this (and see the note in the yellow box):
http://rhq-project.org/display/JOPR2/RHQ+Agent+Installation#RHQAgentInstall…
I don't know if this is related, but perhaps:
http://rhq-project.org/display/JOPR2/FAQ#FAQ-WhenIshutdowntheagent%2CtheRHQ…
I think you want to change the agent preference
"rhq.agent.plugins.availability-scan.period-secs" - its got a comment in
agent-configuration.xml to tell you what it is for.
John Mazz
-------- Original Message --------
Subject: Re: Things I dont know how to do with plugins
Date: Wed, 27 Jan 2010 16:55:42 -0500
From: John Holland <jholland(a)vizuri.com>
Reply-To: rhq-devel(a)lists.fedorahosted.org
To: rhq-devel(a)lists.fedorahosted.org
Hello,
I'm posing this question here as I think this list will have the most
knowledgeable people about RHQ. This is a bit of an end user question
though.
We're looking at using RHQ/JON to monitor VMs. I have set up a template
for VMs that has jboss EAP 5.0 and rhq-agent. What I'm running into is
that it takes a long time for a up/down status change on the Jboss to
register with the JON server. I'm shutting down JBOSS and just waiting
for JON to get the news. in the agent.log I see this which seems to be
the moment the news is sent from the agent:
2010-01-27 16:36:07,365 INFO [InventoryManager.availability-1]
(rhq.core.pc.inventory.InventoryManager)- Sending availability report to
Server...
I believe this was five or ten minutes after I shut down the Jboss, the
log file is a little hard to go through but that's about what it seems.
I was watching the reload timer on the resource page in JON waiting for
it to finally realize the resource was unavailable.
Is there a configuration I can do on the agent or server to make it
react faster to time outs?
I have tried to do it with the agent-configuration.xml in the agent/conf
directory but it doesn't seem to have made it any faster.
Hi,
Many thanks for the clarification - it works ok now.
Best regards,
Alvaro
________________________________
De: rhq-users-bounces(a)lists.fedorahosted.org en nombre de John Mazzitelli
Enviado el: mié 13/01/2010 23:27
Para: rhq-users(a)lists.fedorahosted.org
Asunto: Re: question about RHQ 2.3.1 not discovering Hibernate MBean deployedon a Jboss instance
From the hibernate plugin descriptor, you can see the default name of
the MBean should follow this pattern
"Hibernate:application=%application%,type=statistics" where
%application% is some name you provide when you registered the MBean.
Specifically, see this in the plugin-config:
<c:simple-property name="objectName" readOnly="true"
default="Hibernate:application=%application%,type=statistics"/>
found in the descriptor of the hibernate plugin at
modules/plugins/hibernate (fedorahosted.org is currently down, can't
post a link).
Here's the help text found in the descriptor file that explains how you
can deploy the hibernate bean using Java code:
<p>In order to monitor Hibernate statistics via JON, the
Hibernate Session Manager MBean
must be deployed to an object name of the format
<tt>_"Hibernate:application=%application%,type=statistics"_</tt>, and
statistics must be enabled.</p>
<p>Some example code is provided below to register the
Hibernate Session MBean within an EJB3 application.</p>
<code><pre>
public static void enableHibernateStatistics(EntityManager entityManager)
{
try
{
StatisticsService mBean = new StatisticsService();
SessionFactory sessionFactory =
getHibernateSession(entityManager).getSessionFactory();
mBean.setSessionFactory(sessionFactory);
ObjectName objectName = new
ObjectName(HIBERNATE_STATISTICS_MBEAN_OBJECTNAME);
MBeanServer jbossMBeanServer = getJBossMBeanServer();
jbossMBeanServer.registerMBean(mBean, objectName);
sessionFactory.getStatistics().setStatisticsEnabled(true);
}
catch (InstanceAlreadyExistsException iaee)
{
LOG.info("Duplicate MBean registration ignored: " +
HIBERNATE_STATISTICS_MBEAN_OBJECTNAME);
}
catch (Exception e)
{
LOG.warn("Couldn't register Hibernate statistics MBean.", e);
}
}
private static Session getHibernateSession(EntityManager entityManager) {
Session session;
if (entityManager.getDelegate() instanceof EntityManagerImpl) {
EntityManagerImpl entityManagerImpl = (EntityManagerImpl)
entityManager.getDelegate();
session = entityManagerImpl.getSession();
} else {
session = (Session) entityManager.getDelegate();
}
return session;
}
private static MBeanServer getJBossMBeanServer() {
List<MBeanServer> servers =
MBeanServerFactory.findMBeanServer(null);
MBeanServer jbossServer = null;
for (MBeanServer server : servers) {
if ("jboss".equals(server.getDefaultDomain())) {
jbossServer = server;
}
}
if (jbossServer == null) {
jbossServer = ManagementFactory.getPlatformMBeanServer();
}
return jbossServer;
}
</pre></code>
<p>See also <a
href="http://hibernate.org/216.html">Publishing statistics through
JMX</a> and
<a
href="http://www.redhat.com/docs/manuals/jboss/jboss-eap-4.3/doc/hibernate/Hibern…">Enabling
Hibernate statistics</a></p>
On 01/13/2010 05:17 PM, Alvaro Jose Fernandez wrote:
> I'm having problems trying to get RHQ discover a Hibernate Statistics
> mbean deployed inside an application over a Jboss 4.2.3 server. Also, it
> happens the same when the app is inside a Tomcat container.
>
> All jmx access/level flags (unauthenticated access, no ssl, port
> established) are in place in the JVM invocation , etc.
>
> ## run.conf for the Jboss instance
> JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"
> JAVA_OPTS="$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"
> JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"
> JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=9003"
> JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
> JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
>
> Tried some methods from
> http://www.rhq-project.org/display/RHQ/Plugins+-+Demos+-+Monitoring+Hibe
> rnate to no avail (manually adding a service of type JMX Server)
>
> I'm and dev team are kinda puzzled by this. The app uses Spring and
> Hibernate 3.1. A printscreen from Jconsole (below), or querying
> explicitly the mbean via RMI ..works ok.Tried also using excellent
> jmx_console app from Phillip Traeder, and works ok too:
>
> root@fuchinos:/opt/jmxtools# ./jmx_console.sh get_attribute --host=j2ee
> --port=9003 --object_name=org.hibernate:type=statistics
> --attribute_name=Queries
>
> org.hibernate:type=statistics/Queries : select p from
> ParametroConfiguracion p
>
> root@fuchinos:/opt/jmxtools#
>
> I'm not a java developer, but I'm guessing there would be some sort of
> deviation in the manner the dev team initialized the Hibernate JMX
> mbean, perhaps the naming is not being recognized by the Hibernate RHQ
> plugin because of that?
>
> Any help is much appreciated. Sorry the length and the print screens
> below, they are meant to illustrate a work ok/no ok view (the Hibernate
> plugin folder missing from "j2ee" Jboss instance).
>
> N.b.: print screens erased, since they exceed the maximum for the list.
>
> Regards,
>
> Alvaro
_______________________________________________
rhq-users mailing list
rhq-users(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/rhq-users
Hi,
I'm having problems trying to get RHQ discover a Hibernate Statistics
mbean deployed inside an application over a Jboss 4.2.3 server. Also, it
happens the same when the app is inside a Tomcat container.
All jmx access/level flags (unauthenticated access, no ssl, port
established) are in place in the JVM invocation , etc.
## run.conf for the Jboss instance
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"
JAVA_OPTS="$JAVA_OPTS
-Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServ
erBuilderImpl"
JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=9003"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
.
.
Tried some methods from
http://www.rhq-project.org/display/RHQ/Plugins+-+Demos+-+Monitoring+Hibe
rnate to no avail (manually adding a service of type JMX Server)
I'm and dev team are kinda puzzled by this. The app uses Spring and
Hibernate 3.1. A printscreen from Jconsole (below), or querying
explicitly the mbean via RMI ..works ok.Tried also using excellent
jmx_console app from Phillip Traeder, and works ok too:
root@fuchinos:/opt/jmxtools# ./jmx_console.sh get_attribute --host=j2ee
--port=9003 --object_name=org.hibernate:type=statistics
--attribute_name=Queries
org.hibernate:type=statistics/Queries : select p from
ParametroConfiguracion p
root@fuchinos:/opt/jmxtools#
I'm not a java developer, but I'm guessing there would be some sort of
deviation in the manner the dev team initialized the Hibernate JMX
mbean, perhaps the naming is not being recognized by the Hibernate RHQ
plugin because of that?
Any help is much appreciated. Sorry the length and the print screens
below, they are meant to illustrate a work ok/no ok view (the Hibernate
plugin folder missing from "j2ee" Jboss instance).
N.b.: print screens erased, since they exceed the maximum for the list.
Regards,
Alvaro