-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

James,

On 3/7/14, 1:16 PM, James H. H. Lampert wrote:
> I've been asked to come up with a command-line (or batch job)
> utility (running on an AS/400) to check, programmatically, whether
> a Tomcat context that's part of one of our products is alive and
> accepting connections, or hung.

Do you already have any kind of monitoring infrastructure? If so, what
is it?

> I'm already attempting to pick the brains of our people who
> developed the Tomcat context, to see what they can recommend I do.
> And I've also asked the Midrange List for their suggestions.
> 
> But I'd like the Tomcat List's input as well. One idea I had, since
> we bundle an open-source AS/400 HTTP client library called HTTPAPI
> with the product, was to send test requests to the context via
> HTTPAPI.
> 
> Another idea I've had would be to run some sort of headless test
> Java program, since the AS/400 does include a JVM (after all, it
> wouldn't be able to run Tomcat without one).

Are there any re        quirements that the program be "local" to the JVM
where Tomcat is running? You can connect via TCP to either an HTTP
connection or an AJP to see if a "knock knock" works, and you don't
have to do it with either an AS/400 native application /or/ Java --
you can ping it from the outside if you want.

As for telling if the "context" is up and running, that's a bit tough:
you'll need something available "inside" the context that can tell you
what you want to know. For instance, if you want to know if you can
connect and run a JSP, then just write a JSP called "ping" or
something that writes "OK" back to the response stream. Then just
connect via HTTP and look for that string.

If you're looking for something more robust, you might want to check
for other things -- like the status of the executor's thread pool,
connector status, etc. You can do stuff like via JMX, and there's
already a webapp that ships with Tomcat that will let you inspect JMX
beans via HTTP: the Manager webapp.

If you want to see how you can monitor Tomcat in this way, think about
attending ApacheCon NA 2014 in April in Denver, CO. I'll be giving a
presentation on this exact topic. (Well, not checking "context
health", as that's kind of an application-specific thing).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTGis7AAoJEBzwKT+lPKRYT0MQAL5gBg8erFPArm+NwsItxR0D
Eg/2lvqf6Ksf8t69r8kpbo7t2nQL/2RaRlCo1mkq64fGVZxiUC246AyQofJMMpKr
cnJudhKC5XHrTcwPfb2XLtHzamkLbIrgXS6gPXcyzEXcrFgQBI38T2XTL1JIz5cJ
MPM5w/jE4ouoMFJ2t32ofFA2naXmA/EcY/EKYWW2y+TmslduauVzh+uuSuhyfTCM
9wV34dh16b9BMn7jJ2mqG5L0cyivADiYpF8cO3KoyxY+iPrmjTlLcGGtPU2boS1U
p91COAp5Cpf9zSJ9e/XUyInmTyYyx5hPGQ8oD9Fn0SUzej8167e41hU7jy93mSX/
W/XU2xvfqEVJmdv8RlsB1IQQCwhz0/wGc2snXhRiuF+a4HxomqMkMeuMHUHMG1XZ
C7sYtxJLGgGzIETO/dFhUBdQR8aK8/m7GCJpXiPZxPLux3DenWxGsqVn6UOe6gdA
Wmp4dvEqqbCmKOxkgNi51KV6/eQKGgM97FTw1kd1371AZ1oqADCS307Hf6dsFMbr
30yU+ZSwEuh9IPijTolhhqrpRAgj7wyWMOkIvu2mkYOs1kWUR9u7ErttXq1WRo8g
7jGbf5RlodSf9DroECt9Xk9p885XQPQDeSuLP5MfTx3WcV0YWe49F/9KiK9sQdJ2
9/4fUE+QAxe1+JkirWRw
=gl4p
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to