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 'https://am.example.com:8443/am/json/health/live'
- /json/health/ready checks if the AM instance is ready to process requests. For example:$ curl --include --retry 10 --retry-connrefused 'https://am.example.com:8443/am/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 Monitor AM 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:https://am.example.com:8443/am/isAlive.jsp https://lb.example.com:443/am/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 identity 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 health/* endpoint or the isAlive.jsp endpoint for a more comprehensive check.
In order to use this approach, the User Profile field must be set to Required (navigate to: Realms > [Realm Name] > Authentication > Settings > User Profile in the AM admin UI to check this), and your authentication tree or chain must utilize username and password authentication.
See Authenticate over REST for further information on using REST calls to authenticate.