3 # Simple script which performs a HTTP and rsync check on
4 # all Ceph mirrors over IPv4 and IPv6 to see if they are online
6 # Requires IPv4, IPv6, rsync and curl
9 # - ./test-mirrors.sh eu.ceph.com,de.ceph.com,hk.ceph.com
10 # - cat MIRRORS |cut -d ':' -f 1|xargs -n 1 ./test-mirrors.sh
13 function print_usage {
14 echo "Usage: $0 mirror1,mirror2,mirror3,mirror4,etc"
20 echo -n "$HOST HTTP IPv4: "
21 curl -s -I -4 -o /dev/null http://$HOST
22 if [ "$?" -ne 0 ]; then
28 echo -n "$HOST HTTP IPv6: "
29 curl -s -I -6 -o /dev/null http://$HOST
30 if [ "$?" -ne 0 ]; then
40 echo -n "$HOST RSYNC IPv4: "
41 rsync -4 -avrqn ${HOST}::ceph /tmp 2>/dev/null
42 if [ "$?" -ne 0 ]; then
48 echo -n "$HOST RSYNC IPv6: "
49 rsync -6 -avrqn ${HOST}::ceph /tmp 2>/dev/null
50 if [ "$?" -ne 0 ]; then
59 if [ -z "$MIRRORS" ]; then
64 IFS=', ' read -r -a array <<< "$MIRRORS"
66 for MIRROR in "${array[@]}"; do