-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresume.sh
executable file
·103 lines (62 loc) · 1.98 KB
/
resume.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
PREFIX=$(dirname $0)
if [ ! -e $PREFIX'/sdi.conf' ]; then
echo "ERROR: The $PREFIX/sdi.conf file does not exist or can not be accessed"
exit 1
fi
source $PREFIX'/sdi.conf'
#test if config is loaded
if test $? != 0; then
echo "ERROR: failed to load $PREFIX/sdi.conf file (status.sh)"
exit 1
fi
CONTAINERS=$(ls $CONTAINER_POOL)
CONTAINERSNUM=$(ls $CONTAINER_POOL | wc -l)
printf "Numero total de containeres: "$CONTAINERSNUM"\n"
executando=0;
finalizados=0;
erro=0;
fila=0;
timetou=0;
COUNT=0
for CONTAINER in $CONTAINERS; do
STATUS_CONT="$(cat $CONTAINER_POOL/$CONTAINER/status)"
if [ $STATUS_CONT = "SENT-RUNNING" ] || [ $STATUS_CONT = "ERROR-TRYING-AGAIN" ]; then
let executando=$executando+1;
fi
if [ $STATUS_CONT = "EXECUTED-OK" ]; then
let finalizados=$finalizados+1;
fi
if [ $STATUS_CONT = "FATAL-ERROR" ]; then
let erro=$erro+1;
fi
if [ $STATUS_CONT = "IN-QUEUE" ]; then
let fila=$fila+1;
fi
if [ $STATUS_CONT = "TIMEOUT" ]; then
let timetou=$timetou+1;
fi
done
printf "Na fila de envio: "$fila"\n"
printf "Em execução: "$executando"\n"
printf "Executados com sucesso: "$finalizados"\n"
printf "Não executados (erro fatal): "$erro"\n"
printf "Tempo de execução excedido (timeout): "$timetou"\n"
CLASSES=$(ls $CLASSESDIR)
CONTAINERS=$(ls $CONTAINER_POOL)
CONTAINERSNUM=$(ls $CONTAINER_POOL | wc -l)
exit 0
COUNT=0;
for CLASS in $CLASSES; do
cat $CLASSESDIR/$CLASS | \
while read HOST; do
IS_UP="$(tail -1 $DATADIR/$HOST/status | awk -F' ' '{print $2}' )"
if [ $IS_UP = "ONLINE" ]; then
DOCKER="$(tail -1 $DATADIR/$HOST/checkdocker | awk -F' ' '{print $2}' )"
if [ $DOCKER = "SUPPORT" ]; then
let COUNT=$COUNT+1;
fi
fi
done
done
#printf "Maquinas online com suporte ao Docker: $COUNT\n"