title: GitLab: Push mirror status
agents: gitlab
catalog: app/gitlab
license: GPLv2
distribution: check_mk
description:
 Monitors a push mirror of a GitLab project (Settings > Repository > Mirroring
 repositories), read via GET /projects/:id/remote_mirrors on the source GitLab.
 Reports whether the mirror is enabled, the status of its last sync (mapped via
 the rule "GitLab push mirrors"), a sync error reported by GitLab, how long a
 running sync takes and the age of the last successful sync (no levels by
 default, since GitLab only syncs after a push).

 Optionally (special agent rule, "Verify the mirror target") the target
 repository is queried as well: whether it is archived (rejects pushes), whether
 its default branch is on the same commit as the source and - optionally -
 whether all tags match. In-sync results are cached (default 1 hour, a new push
 on the source invalidates the cache), at most two requests run in parallel
 against a target, and an HTTP 429 pauses all requests to that host until its
 Retry-After time while the last known result is shown. Differences are reported
 as OK during a grace period after a sync started. Only targets on the
 allowed target hosts (default gitlab.com) are queried; others show an error.

 Requires a token with at least the Maintainer role on the source projects;
 private targets need an additional token for the target GitLab.

item:
 The project and the mirror target, e.g. {myproject to gitlab.com/group/myproject}.

discovery:
 One service per push mirror. Mirror monitoring is disabled by default and is
 enabled in the special agent rule.
