Health check service
With the help of the Health Check service, you can perform assessment on the basic and vital functions of your Sitefinity CMS site. Once you enable the service, you can run background checks on whether the site is operational, responsive, and set up properly. The default checks are:
- System Bootstrap
- Start Up
You can also configure additional checks you run on demand to make sure other key aspects of the web application are properly functioning:
- Database access
- NLB communication
- Internet connectivity
- Redis check
PREREQUISITES: Enable the Health check service. Navigate to Administration » Settings » Advanced settings » System » Health check service and select the Enable Health check service checkbox.
In the following sections, you can read details about health check types and how to configure checks.
Health check types
You run health checks by making an HTTP request, consisting of a specific check type associated with the check and sometimes a required parameter.
IMPORTANT: You use parameters only for the checks that require them. In addition, you only use the required parameter and key.
The following table summarizes the types of health checks you can run.
Health check |
Description |
Type |
Required parameter |
System Bootstrap |
Default check.
Provides information only if the Sitefinity CMS system is up and running. |
Telerik.Sitefinity.Health.SystemIsBootstrapped |
None |
Start Up |
Default check.
Provides information when Sitefinity CMS startup is successfully completed. |
Telerik.Sitefinity.Health.StartUpFinished |
None |
Database access |
Provides information whether Sitefinity CMS database is accessible. |
Telerik.Sitefinity.Health.DatabaseCheck |
None |
NLB communication |
Provides information whether communication between nodes is working |
Telerik.Sitefinity.Health.NlbCheck |
None |
Internet connectivity for Google and bing |
Provides information if internet connectivity to configured Google or bing internet address is working.
NOTE: You run two separate checks for each search engine.
|
Telerik.Sitefinity.Health.InternetConnectivityCheck |
Key: url
Value:
Any existing URL, for example:
http://www.bing.com
or http://www.google.com |
Redis check |
Provides information if a load balanced environment with Redis is working |
Telerik.Sitefinity.Health.RedisCheck |
Key: requestTimeout
Value:
Any number, representing a time period in milliseconds.
Default value is 1000
NOTE: If you do not enter any value, the check considers the requestTimeout value to be the default one.
|
You run a general health check, including all additional checks you configured with the following HTTP request:
http://server:port/<path_value>
where:
- server:port is the host and port where the site you want check is running, for example, mysite.com
- <path_value> defines the path where the health check service is accessible. You can replace it with any value, for example: http://mysite.com/restapi/health
You can group checks and associate them with a group name, acting as a tag to better filter the set of results you require. Thus, by running checks by a query parameter that interprets arguments in the query string, you define what checks to run.
You run group health checks by making an HTTP request with the following syntax:
server:port/<path_value>?type=groupname,groupname,…
Where ?type=groupname,groupname,… is the list of groups that you defined on individual health checks. When these parameters are omitted, all enabled checks will run.
For example, group the health checks for connectivity to Google and bing under the group name Internet. Next, run the health check with the following HTTP request: mysite.com/restapi/health?type=Internet
Criticality and health check results
Apart from the default health checks that are critical by default, you optionally set criticality criteria for each of the additional checks. Criticality of checks define which checks affect the end result of a group of checks. For example, you set a the Database connectivity check as critical. If this check is not passed, even if the default health checks are successful, the overall result of the health check is negative.
HTTP status codes
Once you enable the HTTP status code option for the Health check service, you get status codes for each check you run. Status codes provide you with information about whether the health check is successful. If you do not enable this option, you always get the same status code (200).
The following table summarizes the status codes of health checks.
Healthy |
HTTP status code enabled |
Code |
true |
Yes |
200 |
false |
Yes |
500 |
true |
No |
200 |
false |
No |
200 |
For example, you enable the HTTP status code option and you configure the Redis check to be critical, that is with returnHttpErrorStatusCode = true configuration. The check is unsuccessful and thus even if all other checks in the group pass successfully, the overall check result is false and an HTTP return status 500.