What is Tomcat Running?

Tag: , ,

I’m trying to see if a WAR I just built is even running inside of Tomcat (7.0.19). I am deploying to a linux box and so my only two options are the Tomcat admin console (web app) or, hopefully, determining webapp status through the terminal.

I already know how to get in through the console web app; I am wondering if there is any way to see the status (ACTIVE/INACTIVE/TERMINATED, etc) of deployed web apps from the terminal.

Thanks in advance.

4 Answers

  1. fernando-correia on Jul 21, 2012

    curl --user user:pass http://localhost:8080/manager/text/list
    

    It prints

    OK - Listed applications for virtual host localhost
    /manager:running:0:manager
    /docs:running:0:docs
    /examples:running:0:examples
    /host-manager:running:0:host-manager
    /myapp:running:0:myapp
    

    Your user needs the manager-script role. Documentation: Manager App HOW-TO, List_Currently_Deployed_Applications

  2. fernando-correia on Jul 21, 2012

    You can probably do it using JMX.
    Find appropriate MBean that shows this information on local tomcat using regular JConsole. If you want to connect JConsole to remote you will probably have some problems with firewall, so you have other solution.

    Take command line JMX client and run it on the monitored host through SSH terminal. I used the following command line JMX client: cmdline-jmxclient-0.10.3.jar

  3. pharme86 on Jul 21, 2012

    wget http://<username&gt;:<password>@<hostname>:<port>/manager/list -O - -q
    

    (Not sure about Tomcat 7 though)

  4. scott on Jul 21, 2012

    PSI-Probe is a great application for monitoring your applications deployed to a tomcat instance. It will tell you if an application is running or down. If the application is not deployed, it will simply not be in the list.