forked from openshift/origin-aggregated-logging
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check-logs.sh
executable file
·73 lines (67 loc) · 2.54 KB
/
check-logs.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
#!/bin/bash
source "$(dirname "${BASH_SOURCE[0]}" )/../lib/init.sh"
docker_uses_journal() {
# note the unintuitive logic - in this case, a 0 return means true, and a 1
# return means false
# need to be able to handle cases like
# OPTIONS='--log-driver=json-file ....' # or use --log-driver=journald
# if "log-driver" is set in /etc/docker/daemon.json, assume that it is
# authoritative
# otherwise, look for /etc/sysconfig/docker
if type -p docker > /dev/null && sudo docker info | grep -q 'Logging Driver: journald' ; then
return 0
elif grep -q '^[^#].*"log-driver":' /etc/docker/daemon.json 2> /dev/null ; then
if grep -q '^[^#].*"log-driver":.*journald' /etc/docker/daemon.json 2> /dev/null ; then
return 0
fi
elif grep -q "^OPTIONS='[^']*--log-driver=journald" /etc/sysconfig/docker 2> /dev/null ; then
return 0
fi
return 1
}
if [ -z "${USE_JOURNAL:-}" ] ; then
if docker_uses_journal ; then
USE_JOURNAL=true
else
USE_JOURNAL=false
fi
fi
USE_OPERATOR=${USE_OPERATOR:-false}
if oc get clusterlogging > /dev/null 2>&1 ; then
USE_OPERATOR=${USE_OPERATOR:-true}
fi
if [ "$USE_OPERATOR" = true ] ; then
if [ "$1" = "true" ]; then
USE_JOURNAL="${USE_JOURNAL}" \
OAL_ELASTICSEARCH_COMPONENT="es" \
OAL_KIBANA_COMPONENT="kibana-app" \
OAL_ELASTICSEARCH_SERVICE="elasticsearch-app" \
"${OS_O_A_L_DIR}/test/cluster/functionality.sh"
USE_JOURNAL="${USE_JOURNAL}" \
OAL_ELASTICSEARCH_COMPONENT="es-ops" \
OAL_KIBANA_COMPONENT="kibana-infra" \
OAL_ELASTICSEARCH_SERVICE="elasticsearch-infra" \
"${OS_O_A_L_DIR}/test/cluster/functionality.sh"
else
USE_JOURNAL="${USE_JOURNAL}" \
OAL_ELASTICSEARCH_COMPONENT="es" \
OAL_KIBANA_COMPONENT="kibana" \
OAL_ELASTICSEARCH_SERVICE="elasticsearch" \
"${OS_O_A_L_DIR}/test/cluster/functionality.sh"
fi
else
USE_JOURNAL="${USE_JOURNAL}" \
OAL_ELASTICSEARCH_COMPONENT="es" \
OAL_KIBANA_COMPONENT="kibana" \
OAL_ELASTICSEARCH_SERVICE="es" \
"${OS_O_A_L_DIR}/test/cluster/functionality.sh"
if [ "$1" = "true" ]; then
# There is an ops cluster set up, so we
# need to verify it's functionality as well.
USE_JOURNAL="${USE_JOURNAL}" \
OAL_ELASTICSEARCH_COMPONENT="es-ops" \
OAL_KIBANA_COMPONENT="kibana-ops" \
OAL_ELASTICSEARCH_SERVICE="es-ops" \
"${OS_O_A_L_DIR}/test/cluster/functionality.sh"
fi
fi