Date: Thu, 28 Mar 2024 12:29:55 +0000 (UTC) Message-ID: <924896200.5633.1711628995255@fra-prod-wiki01.geant.org> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_5632_1010298059.1711628995253" ------=_Part_5632_1010298059.1711628995253 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Changes required because ss
output now span=
s two lines
#!/b= in/bash # This script runs a bwctl test and, concurrently runs the 'ss' ("show sock= et" command), =20 # at regular intervals during the test. It is recommended the 'ss' interva= l be 0.1 or # or 0.2 (seconds) # # The syntax of the command are: # tcptest <target bwctl server> <length of test in sec> <'ss= ' frequency> # # The results are stored in two files in the user's home directory # 1. tcp_test-<date/time of test>-<target host name>.results # 2. stat_changes-<date/time of test>-<target host name>.result= s # # File 1 is a list of the 'ss' results, which should be graphed # (with the use of a spreadsheet) for ease of interpretation. # File 2 shows the difference between 'netstat -s' immediately before and a= fter # the bwctl test. This is particularly useful for spotting TCP retransmiss= ions etc mkdir $HOME/temp echo $1 >$HOME/temp/target.tmp echo $2 > $HOME/temp/test_length.tmp echo $3 > $HOME/temp/ss_int.tmp test_port=3D5001 host=3D`uname -n` echo "/$test_port/ {print \$0}" > $HOME/temp/awk_filter.tmp test_length=3D`cat $HOME/temp/test_length.tmp` netstat -s > $HOME/temp/stat_before.tmp date +%y%m%d%H%M%S > $HOME/temp/time.tmp test_time=3D`cat $HOME/temp/time.tmp` ( test_time=3D`cat $HOME/temp/time.tmp` target=3D`cat $HOME/temp/target.tmp` test_length=3D`cat $HOME/temp/test_length.tmp` test_interval=3D2 #echo $target echo $test_time > $HOME/tcp_test-$test_time-$host.results bwctl -c $target -t $test_length -i $test_interval >> $HOME/tcp_test-= $test_time-$host.results ) & ( # Sleep interval for 'ss' ss_int=3D`cat $HOME/temp/ss_int.tmp` test_length=3D`cat $HOME/temp/test_length.tmp` bwctl_port=3D5001 test_time=3D`cat $HOME/temp/time.tmp` echo $test_time > $HOME/temp/ss.tmp uname -a >> $HOME/temp/ss.tmp cat $HOME/temp/target.tmp > $HOME/temp/ss.tmp testIterations=3D`echo "($test_length + 10) / $ss_int" | bc` for ((i=3D0; i<$testIterations; i++)) do testTimeNow=3D`echo "$i * $ss_int" | bc` echo -n $testTimeNow $'\t' >> $HOME/temp/ss.tmp /usr/sbin/ss -i dport eq :5001 | sed -e '1 d' -e '/./N;s_\n *_ _' &= gt;> $HOME/temp/ss.tmp echo "" >> $HOME/temp/ss.tmp sleep $ss_int done ) wait netstat -s > $HOME/temp/stat_after.tmp target=3D`cat $HOME/temp/target.tmp` ping -c 3 $target >> $HOME/tcp_test-$test_time-$host.results # This filters out lines without '5001' on them awk -f $HOME/temp/awk_filter.tmp $HOME/temp/ss.tmp>> $HOME/tcp_test-= $test_time-$host.results head -n 20 $HOME/tcp_test-$test_time-$host.results diff $HOME/temp/stat_before.tmp $HOME/temp/stat_after.tmp > $HOME/stat_c= hanges-$test_time-$host.results # Tidy up rm $HOME/temp/*.tmp rmdir $HOME/temp exit 0
=E2=80=93 Main.TobyRodwell - 06 Feb 2007