Health checks are REST endpoints provided by the Nok Nok Authentication, Administration, and API Servers to check if the servers are running and the database can be reached. A health check for the Admin Server also verifies that the transient data purge is enabled and running automatically.
A health check returns an HTTP response with a status code. For the Authentication and Administration Servers, you can append query parameters to the endpoints to get additional information.
Endpoints
The endpoints are accessed via HTTP GET methods. To execute a health check, open a browser and use one of the following URLs to perform a health check. Replace nnl server, ipaddress, and port with values specific to your deployment.
Authentication Server
https://<nnl server/ipaddress>:<port>/nnl/system/healthAdministration Server
https://<nnl server/ipaddress>:<port>/nnladmin/system/healthAPI Server
https://<nnl server/ipaddress>:<port>/nnlgateway/health
Query parameters
You can append any or all of the query parameters listed below to the health check URL to get additional information about the Authentication or Administration Server.
Query Parameter | Description |
|---|---|
gettzinfo | Boolean. Optional. When true, returns the time zone offset from UTC that the database and the Server are set to. |
getversion | Boolean. Optional. When true, returns the version and build number of your Nok Nok deployment. |
level | Integer. Optional. Accepts 0 or 1 only. Requests a health check on the Authentication Server or the Admin Server. See the tables below for a description of level 0 (default) and level 1 health checks on the Authentication Server and the Admin Server. |
tomcatDirDepth | Integer. Optional. When performing a level 1 health check on the Auth Server, this value specifies the depth of that health check. By default, files and directories starting with the Tomcat root directory down to depth 3 are checked for permissions. |
Authentication Server
Level | Checks Performed |
|---|---|
0 |
|
1 | Level 0 checks plus:
|
Admin Server
Level | Checks Performed |
|---|---|
0 |
Response contains only the overall status in "statusCode". |
1 | Level 0 checks plus:
Response contains a status code for each health check and the overall status. |
Status codes
Use the following table to interpret a health check status code.
Status Code | Description |
|---|---|
4000 | The server is healthy. |
4001 | At least one of the automatic jobs is disabled. This could be an expected result because you specifically disabled a job. |
5501 | Internal server error. |
5503 | Database connection failed |
5601 | Error connecting to the Authentication Server. |
5509 | The transient data purge job is not running. |
5510 | A JSP page cannot load due to a syntax error or problem with the Tomcat configuration. |
5511 | Access denied to Tomcat directories/files at the root directory level only. |
5512 | Access denied to one or more Tomcat subdirectories or one or more files in those subdirectories. |
5513 | Unable to get the time zone offset of the database or server. |
5514 | Unable to get a response from Nok Nok Smart Sense. |
Examples
Replace nnl server, ipaddress, and port in these examples with values specific to your deployment.
Authentication Server health check
https://<nnl server/ipaddress>:<port>/nnl/system/healthSample response:
{"statusCode":4000}Admin Server level 1 health check
https://<nnl server/ipaddress>:<port>/nnladmin/system/health?level=1Sample response when a problem is detected, the status returns 5501.
{ "NNLDBConnectHealthCheck":4000, "NNLAdminDBConnectHealthCheck":4000, "ReportDataCreatorHealthCheck":5507,
"ReportAggregateCountHealthCheck":4000, "TransientDataPurgeHealthCheck":5509, "NNLDBReadHealthCheck":4000,
"NNLAdminDBReadHealthCheck":4000, "AdminServerJSPLoadHealthCheck":4000, "statusCode":5501 }Authentication Server, retrieve version number
https://<nnl server/ipaddress>:<port>/nnl/system/health?getversion=trueSample response:
{"version":"9.3.0-321","statusCode":4000}Authentication Server, set tomcat directory depth
https://<nnl server/ipaddress>:<port>/nnl/system/health?level=1&tomcatDirDepth=5Sample response:
{"NNLDBConnectHealthCheck":4000,"NNLDBReadHealthCheck":4000,"TomcatDirectoryPermissionsHealthCheck":4000,"TomcatDirectoryAndFilePermissionsHealthCheck":4000,"statusCode":4000}Authentication Server, with Nok Nok Smart Sense configured
https://<nnl server/ipaddress>:<port>/nnl/system/health?level=1&getversion=trueSample response:
{
"SmartSenseServiceHealthCheck": {
"db_connect_health_check": 4000,
"db_read_health_check": 4000,
"ipaddress_db_config": 5505,
"version": "1.0.0.123"
},
"version": "9.3.0",
"NNLDBConnectHealthCheck": 4000,
"NNLDBReadHealthCheck": 4000,
"TomcatDirectoryPermissionsHealthCheck": 4000,
"TomcatDirectoryAndFilePermissionsHealthCheck": 4000,
"statusCode": 5501
}API Server health check
https://<nnl server/ipaddress>:<port>/nnlgateway/healthSample response:
{"apiServer":"{"statusCode":4000}","authServer":"{"statusCode":4000}"}Administration Server, retrieve time zone offset
https://<nnl server/ipaddress>:<port>/nnladmin/system/health?gettzinfo=trueSample response:
{"tzinfo":{"nnladmin:{"offset":"UTC+05:30","status":4000}, "db":{"offset":"UTC+05:30","status":4000}},"statusCode":4000}