X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fmirroring%2Ftest-mirrors.sh;fp=src%2Fceph%2Fmirroring%2Ftest-mirrors.sh;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=4b6392bf45eb2d6988801780edc53d785ca553cf;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/mirroring/test-mirrors.sh b/src/ceph/mirroring/test-mirrors.sh deleted file mode 100755 index 4b6392b..0000000 --- a/src/ceph/mirroring/test-mirrors.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -# -# Simple script which performs a HTTP and rsync check on -# all Ceph mirrors over IPv4 and IPv6 to see if they are online -# -# Requires IPv4, IPv6, rsync and curl -# -# Example usage: -# - ./test-mirrors.sh eu.ceph.com,de.ceph.com,hk.ceph.com -# - cat MIRRORS |cut -d ':' -f 1|xargs -n 1 ./test-mirrors.sh -# - -function print_usage { - echo "Usage: $0 mirror1,mirror2,mirror3,mirror4,etc" -} - -function test_http { - HOST=$1 - - echo -n "$HOST HTTP IPv4: " - curl -s -I -4 -o /dev/null http://$HOST - if [ "$?" -ne 0 ]; then - echo "FAIL" - else - echo "OK" - fi - - echo -n "$HOST HTTP IPv6: " - curl -s -I -6 -o /dev/null http://$HOST - if [ "$?" -ne 0 ]; then - echo "FAIL" - else - echo "OK" - fi -} - -function test_rsync { - HOST=$1 - - echo -n "$HOST RSYNC IPv4: " - rsync -4 -avrqn ${HOST}::ceph /tmp 2>/dev/null - if [ "$?" -ne 0 ]; then - echo "FAIL" - else - echo "OK" - fi - - echo -n "$HOST RSYNC IPv6: " - rsync -6 -avrqn ${HOST}::ceph /tmp 2>/dev/null - if [ "$?" -ne 0 ]; then - echo "FAIL" - else - echo "OK" - fi -} - -MIRRORS=$1 - -if [ -z "$MIRRORS" ]; then - print_usage - exit 1 -fi - -IFS=', ' read -r -a array <<< "$MIRRORS" - -for MIRROR in "${array[@]}"; do - test_http $MIRROR - test_rsync $MIRROR -done