diff options
Diffstat (limited to 'modules/private/monitoring/plugins/check_git')
-rwxr-xr-x | modules/private/monitoring/plugins/check_git | 81 |
1 files changed, 0 insertions, 81 deletions
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 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | SSH_KEY="$1" | ||
4 | |||
5 | TMPDIR=$(mktemp -d) | ||
6 | |||
7 | if [ ! -d "$TMPDIR" ]; then | ||
8 | echo "gitolite UNKNOWN - impossible to create temp dir" | ||
9 | exit 3 | ||
10 | fi | ||
11 | |||
12 | trap "rm -rf $TMPDIR" EXIT | ||
13 | |||
14 | ERRORS="" | ||
15 | OUTPUT="" | ||
16 | PERFS="" | ||
17 | |||
18 | cd "$TMPDIR" | ||
19 | OUT=$(git clone -q git://git.immae.eu/perso/Immae/Projets/Ruby/Monitor.git 2>&1) | ||
20 | ERR=$? | ||
21 | if [ -n "$OUT" ]; then | ||
22 | OUTPUT="$OUTPUT | ||
23 | $OUT" | ||
24 | fi | ||
25 | if [ "$ERR" != 0 ]; then | ||
26 | PERFS="$PERFS git=0;;;;" | ||
27 | ERRORS="$ERRORS git://" | ||
28 | else | ||
29 | PERFS="$PERFS git=1;;;;" | ||
30 | fi | ||
31 | rm -rf Monitor | ||
32 | |||
33 | OUT=$(git clone -q http://git.immae.eu/perso/Immae/Projets/Ruby/Monitor.git 2>&1) | ||
34 | ERR=$? | ||
35 | if [ -n "$OUT" ]; then | ||
36 | OUTPUT="$OUTPUT | ||
37 | $OUT" | ||
38 | fi | ||
39 | if [ "$ERR" != 0 ]; then | ||
40 | ERRORS="$ERRORS http://" | ||
41 | PERFS="$PERFS http=0;;;;" | ||
42 | else | ||
43 | PERFS="$PERFS http=1;;;;" | ||
44 | fi | ||
45 | rm -rf Monitor | ||
46 | |||
47 | OUT=$(git clone -q https://git.immae.eu/perso/Immae/Projets/Ruby/Monitor.git 2>&1) | ||
48 | ERR=$? | ||
49 | if [ -n "$OUT" ]; then | ||
50 | OUTPUT="$OUTPUT | ||
51 | $OUT" | ||
52 | fi | ||
53 | if [ "$ERR" != 0 ]; then | ||
54 | ERRORS="$ERRORS https://" | ||
55 | PERFS="$PERFS https=0;;;;" | ||
56 | else | ||
57 | PERFS="$PERFS https=1;;;;" | ||
58 | fi | ||
59 | rm -rf Monitor | ||
60 | |||
61 | 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) | ||
62 | ERR=$? | ||
63 | if [ -n "$OUT" ]; then | ||
64 | OUTPUT="$OUTPUT | ||
65 | $OUT" | ||
66 | fi | ||
67 | if [ "$ERR" != 0 ]; then | ||
68 | ERRORS="$ERRORS ssh" | ||
69 | PERFS="$PERFS ssh=0;;;;" | ||
70 | else | ||
71 | PERFS="$PERFS ssh=1;;;;" | ||
72 | fi | ||
73 | rm -rf Monitor | ||
74 | |||
75 | if [ -n "$ERRORS" ]; then | ||
76 | echo "gitolite CRITICAL - impossible to clone via$ERRORS | $PERFS" | ||
77 | exit 2 | ||
78 | else | ||
79 | echo "gitolite OK - ssh, git, http and https work | $PERFS" | ||
80 | exit 0 | ||
81 | fi | ||