diff --git a/check_iperf3.sh b/check_iperf3.sh index ea19fc3..e3b116b 100755 --- a/check_iperf3.sh +++ b/check_iperf3.sh @@ -90,13 +90,13 @@ done if ! command -v iperf3 &>/dev/null; then echo "UNKNOWN - iperf3 not found! Please install iperf3" - exit -1 + exit 3 fi # Check if required arguments are provided if [[ -z "$SERVER" ]] || [[ -z "$WARNING_LEVEL" ]] || [[ -z "$CRITICAL_LEVEL" ]]; then echo "Usage: $0 --server SERVER --warning WARNING_LEVEL --critical CRITICAL_LEVEL [--rsa-public-key RSA_PUBLIC_KEY] [--username USERNAME] [--password PASSWORD]" - exit -1 + exit 3 fi # Set IPERF3_PASSWORD environment variable @@ -112,14 +112,14 @@ for ((i = 1; i <= RETRY; i++)); do # Check if iperf3 command failed if [[ $? -ne 0 ]]; then - if [[ $OUTPUT == *"the server is busy running a test. try again later"* ]]; then + if [[ $OUTPUT == *"the server is busy running a test"* ]]; then if [[ $i -lt $RETRY ]]; then - sleep 30 + sleep 60 continue fi fi echo -e "UNKNOWN - iperf3 command failed: $OUTPUT\n" - exit -1 + exit 3 else break fi