From 67044d45c8843931d4797cee0dfa10d48c1861eb Mon Sep 17 00:00:00 2001 From: Chl Date: Thu, 9 Jan 2020 17:30:21 +0100 Subject: [PATCH] nagios: QnD script pour Gitea version --- nagios/check_gitea_version.sh | 19 +++++++++++++++++++ nagios/etc/84_check-gitea.cfg | 1 + 2 files changed, 20 insertions(+) create mode 100755 nagios/check_gitea_version.sh create mode 100644 nagios/etc/84_check-gitea.cfg diff --git a/nagios/check_gitea_version.sh b/nagios/check_gitea_version.sh new file mode 100755 index 0000000..b4f1c35 --- /dev/null +++ b/nagios/check_gitea_version.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# Quick and dirty NRPE script to check if +# the local version of Gitea is up to date. + +# Stop at first uncatched error +set -e + +# note: some local problems with IPv4, the quickest way was to force IPv6. +LOCAL_VERSION="$( wget -6 -O - -q "https://$( hostname -f )/api/v1/version" | sed -n 's/{"version":"\([^"]\+\)"}/\1/p' )" +UPSTREAM_VERSION="$( wget -q -O - "https://dl.gitea.io/gitea/" | egrep -- '