Created
January 7, 2015 19:12
-
-
Save caglar10ur/51c88484db6e4b9e8d94 to your computer and use it in GitHub Desktop.
iperf-clients
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
base_port=5000 | |
# Command line input: server IP address | |
# E.g. 1.1.1.1 | |
server_ip=$1 | |
shift | |
# Command line input: number of clients to start | |
# E.g. 5 | |
num_clients=$1 | |
shift | |
# Command line input: test duration | |
# E.g. 60 | |
test_duration=$1 | |
shift | |
# Command line input: base report file name | |
# E.g. report | |
report_base=$1 | |
shift | |
# Optional command line input: other iperf options | |
# E.g. -u -b 10M | |
iperf_options="$*" | |
# Run iperf multiple times | |
for i in `seq 1 $num_clients`; do | |
# Set server port | |
server_port=$(($base_port+$i)); | |
# Report file includes server ip, server port and test duration | |
report_file=${report_base}-${server_ip}-${server_port}-${test_duration}.txt | |
# Run iperf | |
iperf -c $server_ip -p $server_port -t $test_duration $iperf_options &> $report_file & | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment