I am attempting to automate throughput measurement of a WLAN using iperf ,so i have a script that will initiate the server (iperf -s -i1 -w2M -t300) and save the contents of the output,send an email and place file in a corporate directory. However, i still have to execute the client side remote command manually (iperf -c 192.168.0.150 -w2M -i1 -t300) .I want to execute one script for both task either by :-
a) Start an SSH process in the script and execute the command. b) Pass an iperf application signal to the remote PC that will induce a process execution.
Please note that by SSH, it will achieve my goal but it will defeat the purpose of my exercise, i want to do functions calling between two machines
I want to have a running application on both sides and the process executed on one.
#!/usr/bin/bash
cwd=$(pwd)
export PATH=$PATH:$cwd
read -p "Name of the file" FXX
read -p "Number of minutes" MMM
iperf -s -i1 -w2M -t"$MMM" | tee "$FXX.txt"
source iperfserver
source /usr/bin/iperfserver
trap exit INT
sshpass -p 'hello' scp "$FXX.txt" bharat@hello:
echo "Hello"|mailx -s "Hello " -a "$FXX.txt" bharat@hello.com
Here is the iperfserver script, so i am trying to coordinate the efforts between the scripts but i am not able to so as soon as i start iperf -s the script stops and i cannot create a simultaneous process. I will try to research on this but if you can help me i will be grateful.
#!/usr/bin/bash
cwd=$(pwd)
export PATH=$PATH:$cwd
sshpass -p 'hello' ssh 192.168.0.101
iperf -c 192.168.0.150 -w2M -i1 -t300
Thanks
Bharat C P