vCenter

 View Only
  • 1.  Tomcat 6 availability issue

    Posted Jul 11, 2008 08:17 PM
    I've set up a Tomcat 6 monitor and all aspects of the tomcat instance are properly recording metrics *except* for availability.

    What does HQ do to test availability? How can I see if it's working and/or fix this?


  • 2.  RE: Tomcat 6 availability issue

    Posted Jul 11, 2008 09:22 PM
    I don't know the answer, but I've got exactly the same situation with Tomcat 5.5.

    I just upgraded to the latest 3.2.4 release hoping that might fix the problem, but no dice.

    Basically, all of the services under the various Tomcat instances are reporting appropriately, but Tomcat 5.5 itself is marked as down and "unavailable".


  • 3.  RE: Tomcat 6 availability issue
    Best Answer

    Posted Jul 11, 2008 10:12 PM
    Tomcat availability is checked via the PTQL statement:
    State.Name.eq=java,Args.*.ct=catalina.home
    Which simple queries the process table and looks for an instance of java.exe that includes the string 'catalina.home' in its command line arguments.

    If that doesn't identify your server, perhaps because you're running it through a service wrapper on Windows or an install4j media executable that masks java.exe, then your sever will report as unavailable. You can change the query in the server configuration screen for the Tomcat resource in Hyperic. A handy query for windows is the simple:
    Pid.Service.eq=<registered_service_name>
    On other platforms it may require some trickery to come up with a query that uniquely identifies your server.

    Handy reference Here:
    http://support.hyperic.com/display/SIGAR/PTQL


    Message was edited by: Matt5D

    As an aside, I do not alert on that availability metric. I set up the Web Hot service inside the TomCat server to check on the context that houses my remoter gateways. This is because there are plenty of ways for things to fail and the actual application to be unavailable that don't crash the TomCat process. For my purposes the availability of the remoter gateway on the web is a much more meaningful availability than simply checking if the tomcat process is still running on the server.

    Message was edited by: Matt5D


  • 4.  RE: Tomcat 6 availability issue

    Posted Jul 14, 2008 04:08 PM
    thanks! that's extremely helpful to know...

    interestingly though, when I start up a SIGAR shell and issue the command directly, I get:


    sigar> ps State.Name.eq=java,Args.*.ct=catalina.home
    8241 tomcat Jul11 2.3G 2.1G 20M S 12:0 java:org.apache.catalina.startup.Bootstrap
    9254 tomcat Jul11 2.4G 340M 20M S 3:20 java:org.apache.catalina.startup.Bootstrap
    sigar>

    in other words, it does indeed seem to show me the 2 active tomcat instances running on that server.
    Why then does the availability metric show that Tomcat is down?

    As you suggest, there are other better metrics to use for alerting purposes, but I just find this 0% availability thing irksome to look at on the web GUI when I know it's wrong.


  • 5.  RE: Tomcat 6 availability issue

    Posted Jul 14, 2008 06:32 PM
    The plugin requires the query to produce a unique result. A query that identifies more than one server is inherently erroneous, so the safe route is to report that something is wrong. (Of course a query could be uniquely identifying the *wrong* server, but there's not much the plugin can do to help you there!)


  • 6.  RE: Tomcat 6 availability issue

    Posted Jul 14, 2008 06:58 PM
    ok... that makes sense. so it looks like I need to tweak the tomcat.xml file to my own specifications in order to properly work with multiple tomcat servers on the same platform. thanks for the help.


  • 7.  RE: Tomcat 6 availability issue

    Posted Jul 12, 2008 12:43 AM
    Thanks alot.

    I looked more closely at that machine and found that there was an old tomcat instance running (not sure how or why).

    I stopped tomcat, killed the old process and restarted and it came back green.

    Thanks again!


  • 8.  RE: Tomcat 6 availability issue

    Posted Dec 03, 2008 03:07 AM
    Yes, thanks! I experimented first with `java -jar sigar.jar` in bundles/agent-4.0.1-905/pdk/lib. We run each of our apps in a separate Tomcat instance, so mine showed no availability because there were multiple matches. But we run each one as a separate user, so for user "foo" I just added ",CredName.User.eq=foo" to its ptql configuration. That worked.