X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=blobdiff_plain;f=modules%2Fprivate%2Fmonitoring%2Fplugins%2Fcheck_git;fp=modules%2Fprivate%2Fmonitoring%2Fplugins%2Fcheck_git;h=0000000000000000000000000000000000000000;hp=e8fbb29d12c7fabe1485472a27d2143113f154a8;hb=1a64deeb894dc95e2645a75771732c6cc53a79ad;hpb=fa25ffd4583cc362075cd5e1b4130f33306103f0 diff --git a/modules/private/monitoring/plugins/check_git b/modules/private/monitoring/plugins/check_git deleted file mode 100755 index e8fbb29..0000000 --- a/modules/private/monitoring/plugins/check_git +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env bash - -SSH_KEY="$1" - -TMPDIR=$(mktemp -d) - -if [ ! -d "$TMPDIR" ]; then - echo "gitolite UNKNOWN - impossible to create temp dir" - exit 3 -fi - -trap "rm -rf $TMPDIR" EXIT - -ERRORS="" -OUTPUT="" -PERFS="" - -cd "$TMPDIR" -OUT=$(git clone -q git://git.immae.eu/perso/Immae/Projets/Ruby/Monitor.git 2>&1) -ERR=$? -if [ -n "$OUT" ]; then -OUTPUT="$OUTPUT -$OUT" -fi -if [ "$ERR" != 0 ]; then - PERFS="$PERFS git=0;;;;" - ERRORS="$ERRORS git://" -else - PERFS="$PERFS git=1;;;;" -fi -rm -rf Monitor - -OUT=$(git clone -q http://git.immae.eu/perso/Immae/Projets/Ruby/Monitor.git 2>&1) -ERR=$? -if [ -n "$OUT" ]; then -OUTPUT="$OUTPUT -$OUT" -fi -if [ "$ERR" != 0 ]; then - ERRORS="$ERRORS http://" - PERFS="$PERFS http=0;;;;" -else - PERFS="$PERFS http=1;;;;" -fi -rm -rf Monitor - -OUT=$(git clone -q https://git.immae.eu/perso/Immae/Projets/Ruby/Monitor.git 2>&1) -ERR=$? -if [ -n "$OUT" ]; then -OUTPUT="$OUTPUT -$OUT" -fi -if [ "$ERR" != 0 ]; then - ERRORS="$ERRORS https://" - PERFS="$PERFS https=0;;;;" -else - PERFS="$PERFS https=1;;;;" -fi -rm -rf Monitor - -OUT=$(GIT_SSH_COMMAND="ssh -i $SSH_KEY -o BatchMode=yes -o UserKnownHostsFile=/dev/null -o CheckHostIP=no -o StrictHostKeyChecking=no" git clone -q gitolite@git.immae.eu:perso/Immae/Projets/Ruby/Monitor 2>&1) -ERR=$? -if [ -n "$OUT" ]; then -OUTPUT="$OUTPUT -$OUT" -fi -if [ "$ERR" != 0 ]; then - ERRORS="$ERRORS ssh" - PERFS="$PERFS ssh=0;;;;" -else - PERFS="$PERFS ssh=1;;;;" -fi -rm -rf Monitor - -if [ -n "$ERRORS" ]; then - echo "gitolite CRITICAL - impossible to clone via$ERRORS | $PERFS" - exit 2 -else - echo "gitolite OK - ssh, git, http and https work | $PERFS" - exit 0 -fi