jboss healthcheck - best way
Environment
- JBoss Enterprise Application Platform(JBoss)
- 6.0.1
Issue
What is the best way to check if particular jboss instance is up and running?
We tried to use jboss-cli for this but would prefer to do this check from bash script - without the use of the CLI.
Resolution
You can use wget to check on the management interface
For example locally this can be done using
wget localhost:9999
a downside of this is that it gives
12:01:09,745 ERROR [org.jboss.remoting.remote.connection] (Remoting "localhost:MANAGEMENT" read-1) JBREM000200: Remote connection failed: java.io.IOException: Received an invalid message length of 1195725856
in the log file.
You'll also need to parse the results from this to ensure you can discriminate between a successful connection and an unsuccessful one.
This will only check the management interface
is available and not that an application has been deployed.
Curl and json can alos be used to interact with the http management interface
well.
See https://docs.jboss.org/author/display/AS71/The+HTTP+management+API and http://middlewaremagic.com/jboss/?p=2488 for some good examples.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments