solana/metrics/scripts/status.sh

52 lines
1.0 KiB
Bash
Raw Normal View History

2019-06-13 08:28:31 -07:00
#!/usr/bin/env bash
#
2019-06-13 08:28:31 -07:00
# Checks the status of local metrics
#
2019-06-13 08:28:31 -07:00
set -e
cd "$(dirname "$0")"
if [[ ! -f lib/config.sh ]]; then
echo "Run start.sh first"
exit 1
fi
# shellcheck source=/dev/null
source lib/config.sh
: "${INFLUXDB_ADMIN_USER:?}"
: "${INFLUXDB_ADMIN_PASSWORD:?}"
: "${INFLUXDB_WRITE_USER:?}"
: "${INFLUXDB_WRITE_PASSWORD:?}"
(
set -x
docker ps --no-trunc --size
)
2019-06-13 12:57:47 -07:00
curl_head() {
curl --retry 5 --retry-delay 2 --retry-connrefused -v --head "$1"
}
if ! curl_head http://localhost:8086/ping; then
echo Error: InfluxDB not running
exit 1
fi
2019-06-13 12:57:47 -07:00
if ! curl_head http://localhost:3000; then
echo Error: Grafana not running
exit 1
fi
2019-06-13 08:28:31 -07:00
cat <<EOF
2019-06-13 08:28:31 -07:00
=========================================================================
* Grafana url: http://localhost:3000/dashboards
username: $INFLUXDB_ADMIN_USER
password: $INFLUXDB_ADMIN_PASSWORD
2019-06-13 08:28:31 -07:00
* Enable metric collection per shell by running:
export SOLANA_METRICS_CONFIG="host=http://localhost:8086,db=testnet,u=$INFLUXDB_WRITE_USER,p=$INFLUXDB_WRITE_PASSWORD"
2019-06-13 08:28:31 -07:00
EOF