VMware Cloud Community
ryan_crawford
Contributor
Contributor

Tomcat Root Webapps

I'm failry new to hyperic and trying to install for monitoring a suite of tomcat webapps we have.

The main issue I have is that several of our webapps in Tomcat's server.xml don't have an explicit contexts assigned...when this is the case Hyperic is (presumably) detecting them all as ROOT webapps and collapsing them down into 1 webapp entry.

i.e. when I go to:
Browse resources
> Servers
> Tomcat 5.5
> MyTimcatInstance

In the Services window I then select "Tomcat 5.5 Webapp" to expand all the webapps and all I see is the 3 entries below, despite there being many virtual hosts and services all running in Tomcat (albeit with ROOT contexts).

MyTimcatInstance /host-manager Tomcat 5.5 Webapp
MyTimcatInstance /hyperic-hq Tomcat 5.5 Webapp
MyTimcatInstance /ROOT Tomcat 5.5 Webapp


I'm running server version 3.0 and agent version 3.1...would upgrading to 3.2/3.2 fix the issue? Is it a known issue? Is there some magic config I'm missing?

I can't find much about it on the forum or the internet in general, any help would be appreciated.
Thanks.
Reply
0 Kudos
12 Replies
laullon
VMware Employee
VMware Employee

Hi,

HQ use JMX for detect all Tomcat services.
Therefore, if a webapp don't have context, it had not been registered in the server JMX
Reply
0 Kudos
ryan_crawford
Contributor
Contributor

And there's no way of working around / configuring it differently? Seems a shame to not be able to use such a good tool simply because of an application architecture choice.
Reply
0 Kudos
admin
Immortal
Immortal

There are some other options you can try. The "Tomcat 5.5" type in HQ uses Hyperic's servlet filter and webapp to instrument the metrics and is a bit out-dated.

If you are running Tomcat 5.5 with Java 1.5, you can use the "Apache Tomcat 5.5" type, which uses JMX to collect counter information directly from Tomcat. You can see what information is available by connecting to your application via jconsole. This method does not require you instrument your application with Hyperic's servlet filter.

To try this, create the "Apache Tomcat 5.5" type by hand. You can do this by navigating to the platform running Tomcat and selecting "New Server" from the tools menu in the upper right hand corner.

HTH,
-Ryan
Reply
0 Kudos
JohnMarkOrg
Hot Shot
Hot Shot


Ryan,

Thanks for this. I'll post a snippet to the forge.

-JM


Excerpts from Ryan Morgan's message of Thu Jan 31 09:50:52 -0800 2008:
> There are some other options you can try. The "Tomcat 5.5" type in HQ uses
> Hyperic's servlet filter and webapp to instrument the metrics and is a bit
> out-dated.
>
> If you are running Tomcat 5.5 with Java 1.5, you can use the "Apache Tomcat
> 5.5" type, which uses JMX to collect counter information directly from Tomcat.
> You can see what information is available by connecting to your application via
> jconsole. This method does not require you instrument your application with
> Hyperic's servlet filter.
>
> To try this, create the "Apache Tomcat 5.5" type by hand. You can do this by
> navigating to the platform running Tomcat and selecting "New Server" from the
> tools menu in the upper right hand corner.
>
> HTH,
> -Ryan

Reply
0 Kudos
ryan_crawford
Contributor
Contributor

I've set things up to use Tomcat's own JMX and it's pulling back tomcat level stats....but no info on the individual services running within tomcat.

I can see several things via the JConsole, but Hyperic isn't pulling the info in any way that resembles individual webapps. There's no 'services' listed under tomcat at all in fact.

Also, I can't seem to set Auto-discover of services, every time I tick the box and commit the change it comes back as OFF....presumably this feature is tied to Hyperic's own JMX webapp impl.?

Is there a manual way I can add the individual Webapps running under tomcat, or some way to enable the auto-discovery?

Thanks so much for your help thus far, it's very much appreciated!
Reply
0 Kudos
roger_symonds
Enthusiast
Enthusiast

Hi Ryan,

So far the only way I can see that this can be done is to write a custom Mbean for each application on Tomcat. The aim of the custom Mbean is to expose the information from one application you wish to monitor in Hyperic. (More applications = more Mbeans, eg. 1 to 1)
Once you have the custom Mbean written, you then need to write a Hyperic JMX plugin that hooks to the custom Mbean, and collects the data.

Does anyone know of an easier way?

Regards,
Roger
Reply
0 Kudos
ryan_crawford
Contributor
Contributor

We have over 40 production services which themselves all need ongoing code maintenace, adding custom MBeans and JMX Plugins for each one is pushing the amount of effort beyond the boundaries of convenience.
Reply
0 Kudos
ryan_crawford
Contributor
Contributor

Thanks for your advice Roger, I've spoken with one of our developers and it sounds like we have 2 paths ahead of us.

1. We're going to look into writing custom MBeas for each of our application shapes and see where we get.

However, it does sound like a lot of work for what is essentially could be considered a flaw/bug at Hyperic's end. Each webapp we're running has it's own context xml file and runs sandboxed in their own vhosts.

The JConsole does pull the info at the vhost level, so it just seems tht Hyperic is unable to interpret the information in such a way that they're separated.

So, this brings us to our second way forward... is there any way I can feed this back into Hyperic so they maybe look into it and address this in their next release?

Thanks all for your help thus far, it's very much appreciated.
Ryan.
Reply
0 Kudos
roger_symonds
Enthusiast
Enthusiast

Hi Ryan,

Hyperic do have a JIRA instance at: http://jira.hyperic.com/
However I think it's closed to the public, so you might need one of the Hyperic guys to raise it for you.
I think John Mark is the Hyperic community manager, and is very helpful with requests from the forums, but any of the guys should be able to raise it for you.
There was a bug day recently, see: http://support.hyperic.com/confluence/display/hypcomm/Hyperic+Bug+Day
but I think this is more of a feature request.

Just throwing around some ideas, I suppose the only other options that I can see is to change the applications server to JBoss (easier to write MBeans for - so I've heard), or run each application on it's own application server, this way you get metrics about each application, at the app-server level. It sounds like these probably aren't options available to you, and would require a major overhaul of your architecture.
Again, just throwing around some ideas.

Regards,
Roger
Reply
0 Kudos
jeremy_koerber
Contributor
Contributor

I am at the exact same point as Ryan on his Feb 1, 2008 4:45 AM post above. I have it pulling back stats on Tomcat, but it won't discover any connectors or webapps. Also, the "Auto-Discovery for Caches, DataSource Pools, and other services is OFF" checkbox won't work for me either. I check the box and click OK, but it just goes right back to OFF. I'm actually having better luck getting all of the metrics collected through the webapp at http://localhost:8080/hyperic-hq/jmx-attributes?dmp=hyperic-hq:*

However I'd like to have both working.. The setup for the JMX direct method is much quicker, but I just need that auto-discover services to work. Any help would be much appreciated!!

Thanks,
Jeremy
Reply
0 Kudos
tluks
Contributor
Contributor

I was able to solve the OFF problem with the information in the last few posts on this thread:
http://communities.vmware.com/message/1926998#1926998
Reply
0 Kudos
deeboh
Enthusiast
Enthusiast

Hey Ryan, I can't speak for tomcat 5.5, but I do know that the tomcat 6.0 autodiscover and metric gathering display is flawless. I'm currently using HQ open source 3.2.2 and the setup was as easy as can be.

Once the agent found the Tomcat installation all I had to do was to follow the setup instructions in configuration properties. namely I had to instrument catalina.sh to allow tomcat to push metrics on the the jmx url, then restart catalina, I also had to setup a users.xml file for some reason non-authenticated jmx monitoring wasn't working. but I probably need to set -Dauthentication=false somewhere but found it easier to just create a tomcat manager.

Configure Apache Tomcat for JMX

From the Hyperic config props page
To configure Tomcat for JMX monitoring see http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html.
For a quick down and dirty method follow these instructions,
in /bin/catalina.sh add:
[ $1 != "stop" ] && JAVA_OPTS="-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=6969 \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false $JAVA_OPTS"
export JAVA_OPTS


then add a manager user to the tomcat-users.xml file (unless you include -Dauthenticate=false) something like that.

From there restart Tomcat and that is it.

However this was for Tomcat 6.0. Not sure if it'll work for 5.5.

Best of luck,

Deeboh
Reply
0 Kudos