-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist.sh
More file actions
executable file
·66 lines (52 loc) · 2.83 KB
/
Copy pathlist.sh
File metadata and controls
executable file
·66 lines (52 loc) · 2.83 KB
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
#!/bin/bash -eu
NO_LOCK_REQUIRED=false
. ./.env
. ./.common.sh
HOST=${DOCKER_PORT_2375_TCP_ADDR:-"localhost"}
# Displays links to exposed services
echo "${bold}*************************************"
echo "Client ${version}"
echo "*************************************${normal}"
echo "List endpoints and services"
echo "----------------------------------"
# Displays services list with port mapping
docker-compose ps
dots=""
maxRetryCount=50
# Determine if ELK is setup
elk_setup=true
if [ -z $(docker-compose -f docker-compose_elk.yml ps -q kibana) ] || [ -z $(docker ps -q --no-trunc | grep $(docker-compose -f docker-compose_elk.yml ps -q kibana)) ] ||
[ -z $(docker-compose -f docker-compose_elk_poa.yml ps -q kibana) ] || [ -z $(docker ps -q --no-trunc | grep $(docker-compose -f docker-compose_elk_poa.yml ps -q kibana)) ]; then
elk_setup=false
fi
if [ $elk_setup == true ]; then
while [ "$(curl -m 10 -s -o /dev/null -w ''%{http_code}'' http://"${HOST}":5601/api/status)" != "200" ] && [ ${#dots} -le ${maxRetryCount} ]
do
dots=$dots"."
printf "Kibana is starting, please wait $dots\\r"
sleep 10
done
echo "Setting up the metricbeat index pattern in kibana"
curl -X POST "http://${HOST}:5601/api/saved_objects/index-pattern/metricbeat" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '{"attributes": {"title": "metricbeat-*","timeFieldName": "@timestamp"}}'
curl -X POST "http://${HOST}:5601/api/saved_objects/_import" -H 'kbn-xsrf: true' --form file=@./monitoring/kibana/besu_overview_dashboard.ndjson
echo "Setting up the besu index pattern in kibana"
curl -X POST "http://${HOST}:5601/api/saved_objects/index-pattern/besu" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '{"attributes": {"title": "besu-*","timeFieldName": "@timestamp"}}'
fi
echo "****************************************************************"
if [ ${#dots} -gt ${maxRetryCount} ]; then
echo "ERROR: Web block explorer is not started at http://${HOST}:${explorerPort} !"
echo "****************************************************************"
else
echo "JSON-RPC HTTP service endpoint : http://${HOST}:8545"
echo "JSON-RPC WebSocket service endpoint : ws://${HOST}:8546"
echo "GraphQL HTTP service endpoint : http://${HOST}:8547"
echo "Web block explorer address : http://${HOST}:25000/"
echo "Prometheus address : http://${HOST}:9090/graph"
echo "Grafana address : http://${HOST}:3000/d/XE4V0WGZz/besu-overview?orgId=1&refresh=10s&from=now-30m&to=now&var-system=All"
if [ $elk_setup == true ]; then
echo "Kibana logs address : http://${HOST}:5601/app/kibana#/discover"
fi
echo "****************************************************************"
fi
# Copyright 2018 ConsenSys AG.
# http://www.apache.org/licenses/LICENSE-2.0