Check gitlab-liveness¶
Overview¶
Checks whether the GitLab application server is alive by querying the /-/liveness endpoint. This probe detects deadlocked Rails controllers caused by multi-threading issues. A successful response confirms that no controllers are deadlocked.
Important Notes:
- GitLab 12.4 or later
- The requesting client IP must be included in the GitLab monitoring allowlist. See how to add IPs to the allowlist.
- This check is exempt from Rack Attack rate limiting.
- GitLab Health Checks documentation: https://docs.gitlab.com/ee/administration/monitoring/health_check.html
Data Collection:
- Sends an HTTP GET request to the GitLab liveness endpoint (default:
http://localhost/-/liveness) - Expects a JSON response containing a "status" field and no "error" field
Fact Sheet¶
| Fact | Value |
|---|---|
| Check Plugin Download | https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/gitlab-liveness |
| Nagios/Icinga Check Name | check_gitlab_liveness |
| Check Interval Recommendation | Every minute |
| Can be called without parameters | Yes |
| Runs on | Cross-platform |
| Compiled for Windows | No (runs with Python interpreter) |
Help¶
usage: gitlab-liveness [-h] [-V] [--always-ok] [--insecure] [--no-perfdata]
[--no-proxy] [--proxy PROXY] [--severity {warn,crit}]
[--timeout TIMEOUT] [--url URL]
Checks whether the GitLab application server is alive by querying the
/-/liveness endpoint. This probe detects deadlocked Rails controllers caused
by multi-threading issues. Requires GitLab 12.4 or later. Alerts when the
server does not respond or reports a deadlock.
options:
-h, --help show this help message and exit
-V, --version show program's version number and exit
--always-ok Always returns OK.
--insecure This option explicitly allows insecure SSL
connections.
--no-perfdata Suppress the performance data section from the output.
The status message and the exit code are unaffected,
so alerting keeps working while trending data is
dropped.
--no-proxy Do not use a proxy, not even one the environment
names. Overrides `--proxy`.
--proxy PROXY Proxy to reach the target through. The scheme defaults
to `http` when omitted. Overrides the proxy the
environment names (`http_proxy`, `https_proxy`,
`all_proxy`) together with the exceptions it lists in
`no_proxy`, and is itself overridden by `--no-proxy`.
Without either parameter the environment applies.
Credentials belong into the environment variable
rather than here, because a command-line argument is
visible to every user on the host. Example:
`--proxy=http://proxy.example.com:3128`.
--severity {warn,crit}
Severity for alerting. Default: warn
--timeout TIMEOUT Network timeout in seconds. Default: 8 (seconds)
--url URL GitLab liveness URL endpoint. Default:
http://localhost/-/liveness
Documentation:
https://linuxfabrik.github.io/monitoring-plugins/check-plugins/gitlab-liveness/
Usage Examples¶
./gitlab-liveness --severity=warn --timeout=3 --url=http://localhost/-/liveness
Output:
The GitLab application server is running. No Rails Controllers are deadlocked.
States¶
- OK if the
/-/livenessendpoint returns a valid status without errors. - WARN or CRIT (depending on
--severity, default: WARN) if the endpoint returns an error or a deadlock is detected. - UNKNOWN if the response does not contain a "status" field and no "error" field.
--always-oksuppresses all alerts and always returns OK.
Perfdata / Metrics¶
| Name | Type | Description |
|---|---|---|
| gitlab-liveness | Number | The current state (0 = OK, 1 = WARN, 2 = CRIT, 3 = UNKNOWN). |
Credits, License¶
- Authors: Linuxfabrik GmbH, Zurich
- License: The Unlicense, see LICENSE file.