On-premise administrators can configure a health check endpoint in NetX to observe the status of their on-premise instances. When the endpoint receives a request, NetX will attempt to test the following components:
- Tomcat
- Database (SQL Server/MySQL)
- Solr
- Redis (if enabled)
A healthy system will return an HTTP status code of 200 Ok. If one or more services fail the check, the endpoint will return an HTTP status code of 500 Internal Server Error and log a warning of all services and their current states to exogen.log. An example log entry is shown below:
2023-10-10 12:39:55,542 ERROR http-nio-9000-exec-1 HealthCheckResource performHealthCheck Unhealthy: ({"domain":"https://instance.netx.net","status":false,"checks":{"tomcat":true,"mysql":true,"solr":false,"redis":true}})
Enabling the endpoint
By default, the health check endpoint is disabled. To enable it, create a token using the property below:
Property | Description |
---|---|
healthCheck.token |
Set the value of this property to a unique string of your choice. We recommend generating a v4 UUID. For example: ace1bf53-d6ae-4db1-841f-b2cf5dd3a7c8 If the value of the property is empty, or not set, the health check endpoint will be disabled. Value options: UUID Requires restart? No |
After the token is configured, the endpoint will be reachable at the following URL:
https://<sitename>/health/<healthCheck.token>
For example:
https://dam.mycompany.com/health/ace1bf53-d6ae-4db1-841f-b2cf5dd3a7c8
Status codes
The following HTTP status codes can be returned from the endpoint in certain contexts:
Status code | Description |
---|---|
200 Ok |
All NetX services are responding to the health check. |
401 Unauthorized |
The token listed in the URL does not match the value of the healthCheck.token property, or the URL is invalid. |
404 Not Found |
The healthCheck.token property is not configured or has an empty/invalid value. |
500 Internal Server Error |
One or more NetX services have failed the health check. Check the exogen.log for more details. |
Securing your endpoint
NetX does not throttle requests to the health check endpoint. We recommend that you secure network traffic to prevent unauthorized access.