X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=blobdiff_plain;f=modules%2Fprivate%2Fmonitoring%2Fplugins%2Fcheck_git;h=e8fbb29d12c7fabe1485472a27d2143113f154a8;hp=8c09925cfbf06bcddfc4bb6e492e64a101fd51f9;hb=a97118c489a59d723538292214efaa10dfcb96df;hpb=b1b8a5623d22a7ee4301afe4e7b9d368ef7ded8f diff --git a/modules/private/monitoring/plugins/check_git b/modules/private/monitoring/plugins/check_git index 8c09925..e8fbb29 100755 --- a/modules/private/monitoring/plugins/check_git +++ b/modules/private/monitoring/plugins/check_git @@ -13,6 +13,7 @@ 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) @@ -22,7 +23,10 @@ OUTPUT="$OUTPUT $OUT" fi if [ "$ERR" != 0 ]; then + PERFS="$PERFS git=0;;;;" ERRORS="$ERRORS git://" +else + PERFS="$PERFS git=1;;;;" fi rm -rf Monitor @@ -34,6 +38,9 @@ $OUT" fi if [ "$ERR" != 0 ]; then ERRORS="$ERRORS http://" + PERFS="$PERFS http=0;;;;" +else + PERFS="$PERFS http=1;;;;" fi rm -rf Monitor @@ -45,6 +52,9 @@ $OUT" fi if [ "$ERR" != 0 ]; then ERRORS="$ERRORS https://" + PERFS="$PERFS https=0;;;;" +else + PERFS="$PERFS https=1;;;;" fi rm -rf Monitor @@ -56,13 +66,16 @@ $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|$OUTPUT" + echo "gitolite CRITICAL - impossible to clone via$ERRORS | $PERFS" exit 2 else - echo "gitolite OK - ssh, git, http and https work|$OUTPUT" + echo "gitolite OK - ssh, git, http and https work | $PERFS" exit 0 fi