You can perform a couple of checks to see if AM is up and running, depending on your requirements and AM version.
You can use the following endpoints to check if an instance is running and ready to handle requests:
- /json/health/live checks if the AM instance is up and running. For example:$ curl --include --retry 10 --retry-connrefused 'http://host1.example.com:8080/openam/json/health/live'
- /json/health/ready checks if the AM instance is ready to process requests. For example:$ curl --include --retry 10 --retry-connrefused 'http://host1.example.com:8080/openam/json/health/ready'
If the AM instance is running/ready to process requests, the endpoint will return an HTTP status code of 200. If not, it returns a 503 response.
One of the readiness checks the endpoint performs is that the CTS queue is not overloaded. The endpoint returns an HTTP 503 error if the following are both true:
- The CTS queue is more full than the configured threshold property (
- The CTS data store is available.
See Monitoring Instances for further information.
You can send a request to the isAlive.jsp endpoint; this request can either be sent to the server URL or the load balancer URL, for example:http://host1.example.com:8080/openam/isAlive.jsp http://lb.example.com:8080/openam/isAlive.jsp
If you receive a HTTP 200 OK response, the status page will return Server is ALIVE: at this point you have verified AM is up and running, and can communicate with its configuration store; otherwise, this currently throws an exception, which causes the web server to return an error code of 500. If AM is not running you will receive a message saying the browser could not connect.
If AM is running and the directory server used for the configuration store is not reachable, the status page will return Server is DOWN.
The isAlive.jsp endpoint is deprecated in AM 7.1.
You can perform a login operation using a REST call followed by a logout operation to remove the created session. If you can authenticate successfully, you know that your user store is reachable; this also means that AM is up and running, so you can use this authentication check instead of sending a request to the isAlive.jsp endpoint for a more comprehensive check.
The core authentication settings for the realm you are authenticating against must have been set to Profile Required, and you must have an authentication module in your authentication chain that utilizes username and password authentication to be able to use this approach.
Alternatively, you could perform a login operation using invalid credentials. The failed authentication due to invalid credentials verifies AM and the user data store are communicating and functioning correctly, but means that a logout operation to destroy the created session is not needed.
See Authenticating (REST) for further information on using REST calls to authenticate.