check_iperf3: bump up the busy wait

This commit is contained in:
Cyberes 2024-03-04 09:48:45 -07:00
parent ab260fc6e0
commit caec638872
1 changed files with 5 additions and 5 deletions

View File

@ -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