Skip to main content

Kasm Services Healthcheck

Overview​

The healthcheck system is a container-based health monitoring solution that monitors the health of Kasm Workspaces Docker services. Each service container uses a custom script that performs health validation with exponential backoff retry logic and state persistence across container restarts.

Healthcheck Endpoints​

Each service provides standardized healthcheck endpoints that return JSON responses indicating service status:

> curl -k https://<kasm-server>/api/__healthcheck
{"ok": true}

Healthcheck Script Parameters​

The container healthcheck system uses /usr/bin/healthcheck.sh with the following parameters:

/usr/bin/healthcheck.sh <target_url> <port> <retry_delay> <max_delay> <healthcheck_timeout>

Parameter Details​

ParameterDescriptionExampleRequired
target_urlHTTP/HTTPS endpoint to validate service healthhttp://localhost:8080/api/__healthcheckYes
portTCP port to verify is listening (use "" to skip)3389 or ""No
retry_delayDelay between retries in seconds (default: 1)5No
max_delayMaximum delay for exponential backoff (default: 30)60No
healthcheck_timeoutThe maximum time allowed for performing the healthcheck curl command (default: 5)10No

Example Configurations​

API Service:

/usr/bin/healthcheck.sh http://localhost:8080/api/__healthcheck "" 5 60

RDP Gateway (with port check):

/usr/bin/healthcheck.sh http://localhost:5555/__healthcheck 3389 1 30

Agent Service (longer delays):

/usr/bin/healthcheck.sh http://localhost:4444/__healthcheck "" 30 90

Docker Healthcheck Considerations​

While standard Docker healthcheck parameters (interval, timeout, retries, start_period) apply to all services, ensure the Docker timeout parameter is not less than the script's internal healthcheck_timeout.