Zabbix monitoring of gitlab

Hello,
I couldn’t find a published template for gitlab monitoring by zabbix, so I came here to ask…

I was wondering if anyone has written any zabbix plugins/probes to monitor gitlab. I’m happy to take anything anybody’s written and polish it up to make a template, simply so I don’t have to start from scratch. Or maybe someone wants to team up on the effort?

thanks,
Paul

Hi @speculatrix,

I don’t have enough experience with Zabbix to answer your question directly, maybe a community member can point you in the right direction.

Depending on your needs, GitLab’s built-in Prometheus monitoring and Grafana dashboard services might be a simpler and already-integrated solution to achieve the same goal.

Hi there, @speculatrix,
Of course, zabbix users want to have monitor on one place, as much as possible.
Here are some basic checking for zabbix according to manual: https://www.zabbix.com/documentation/current/manual/config/items/itemtypes/zabbix_agent (part of proc.num, i.e. checking if process is active, at least one for each monitored instance)

Creating several Items.
For nginx :

    key: proc.num[nginx,,all]

For postgres:

    key: proc.num[postgres,gitlab-psql,all]

For redis-server:

    key: proc.num[redis-server,,all]

Triggers for nginx:

   Problem expression
   {gitlab:proc.num[nginx,,all].last(0)}<1
   Recovery:
   {gitlab:proc.num[nginx,,all].last(0)}>0

And triggers respectively for postgres and redis-server:

   {gitlab:proc.num[postgres,gitlab-psql,all].last(0)}<1
   {gitlab:proc.num[redis-server,,all].last(0)}<1

(on the same manner putting recovery triggers).

I’ve put a checking within a “Web scenario” (web checks, define URL and expected text on the page)
and trigger like:
{gitlab:web.test.fail[Availability of Gitlab].sum(#3)}>0

These are just a basic monitoring fields, certainly this can be better. I couldn’t find the proper way to check unicorn process. The name is not just a unicorn , not catching the process even with combinations visible on linux typical commands like ps aux | grep unicorn

However, I hope someone might find this useful.

Hi @speculatrix,

Zabbix published a supported template to monitor on-prem Gitlab via HTTP. It was released for Zabbix 5.2 and 5.4. You can find details at https://support.zabbix.com/browse/ZBXNEXT-6329 and Browse Zabbix / Zabbix - ZABBIX GIT for docs.

As @gitlab-greg said, you can use Prometheus to monitor GitLab and add it as a datasource in Grafana for visualization and alerting.

I hope this helps.

1 Like

Hi,

thanks for the update :+1:

Since Prometheus is mentioned here, linking the CI pipeline efficiency docs which include the great GitLab CI Pipeline Exporter & dashboards too :slight_smile: Hopefully the ideas are also helpful for Zabbix metrics, e.g. as a queryable interface.

Cheers,
Michael