-
Notifications
You must be signed in to change notification settings - Fork 0
/
monitor.sh
22 lines (19 loc) · 824 Bytes
/
monitor.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# Declare an array of node names
declare -a nodes=("sentry0-ap-southeast-1-testnet"
"sentry0-eu-west-1-testnet"
"sentry0-us-east-1-testnet"
"sentry0-us-west-2-testnet"
"sentry1-ap-southeast-1-testnet"
"sentry1-eu-west-1-testnet"
"sentry1-us-east-1-testnet"
"sentry1-us-west-2-testnet"
"sentry2-us-east-1-testnet")
# Loop through each node in the array
for node in "${nodes[@]}"
do
# Assuming that the IP address for each node is stored in a DNS that can resolve it
# Using curl to fetch data and jq to parse JSON
echo "Fetching data from $node:"
curl -s --max-time 3 "http://$node:26657/consensus_state" | jq '.result.round_state."height/round/step"'
done