Gitlab version check failed

Hi everyone,

we found a script to check the official gitlab version from version.gitlab.com. It compares to our installed version and sends a trigger to our zabbix instance if an update is available and if it’s “asap”, et cetera…

But since a few days it’s not working anymore, our version check delivers an empty field.

This is the code we found on the internet:

#!/bin/bash

HOSTNAME=“hostname”
GITLAB_URL=“our_url”
API_TOKEN=“API_TOKEN”
echo "Connecting to Gitlab-URL GITLAB_URL" sleep 2 GITLAB=(curl -s -H “PRIVATE-TOKEN: $API_TOKEN” $GITLAB_URL/api/v4/version | jq .version)
if [[ $GITLAB == “null” ]]; then
echo “Could not retrieve version from ‘$GITLAB_URL’. Is your API token correct?”
exit 1
fi
echo "Currently installed Gitlab Version: GITLAB" sleep 2 ENCODED=(echo ‘{“version”:’$GITLAB’}’ | base64 -i -)
echo "Encoded Base64-Format: ENCODED" sleep 2 VERSION=(curl -s -H “Accept: image/png,image/svg+xml,image/;q=0.8,video/;q=0.8,/;q=0.5
Referer: $GITLAB_URL
DNT: 1
Host: version.gitlab.com
Accept-Language: en-us
Accept-Encoding: br, gzip, deflate
Connection: keep-alive” https://version.gitlab.com/check.svg?gitlab_info=$ENCODED)
echo VERSION | grep -q "up-to-date" if [[ ? == 0 ]]; then
zabbix_sender -z zabbixhost -s $HOSTNAME -k status.gitlab.version -o 0
echo “Up to date”
fi
echo VERSION | grep -q "update available" if [[ ? == 0 ]]; then
zabbix_sender -z zabbixhost -s $HOSTNAME -k status.gitlab.version -o 1
echo “Update available”
fi
echo VERSION | grep -q "update asap" if [[ ? == 0 ]]; then
zabbix_sender -z zabbixhost -s $HOSTNAME -k status.gitlab.version -o 2
echo “Update asap”
fi

And it failes here:

Connection: keep-alive" https://version.gitlab.com/check.svg?gitlab_info=$ENCODED)

and doesn’t bring a result.

So at the moment we don’t have a solution to check our gitlab version against the official repo.

Can someone assist us here with this issue? Maybe there’s a better solution for this in general and we didn’t see it so far…

Thank you!