How to save Iperf result in an output file

Rakhee Tiwari picture Rakhee Tiwari · Sep 6, 2014 · Viewed 27.8k times · Source

I am running iperf between a set of hosts that are read from a txt file, here's how I am running it:

h1,h2 = net.getNodeByName(node_id_1, node_id_2)

net.iperf((h1, h2))

It runs well and displays the results. But, I want to save the output of iperf result in a separate txt file. Does anyone know how I can apply it on the above code?

Answer

user3107629 picture user3107629 · Dec 6, 2015

In order to store the results of iperf test in a file , add | tee followed by the filename.txt to your command line for example :

iperf -c ipaddress -u -t 10 -i 1 | tee result.txt