python-如何将Iperf结果保存在输出文件中

我正在从txt文件读取的一组主机之间运行iperf,这是我运行它的方式:

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

net.iperf((h1, h2))

它运行良好并显示结果.但是,我想将iperf结果的输出保存在单独的txt文件中.有谁知道我如何将其应用于上面的代码?

解决方法:

我也有这个问题.尽管手册页指定了“ -o”或“ –output”来将输出保存到文件中,但这实际上不起作用.

看来这被标记为“ WontFix”:
https://code.google.com/p/iperf/issues/detail?id=24

Looks like -o/–output existed in a previous version but in not in the
current version. The consensus in yesterday’s meeting was that if
–output existed then we should fix it, otherwise people should just use shell redirection and we’ll mark this WontFix. So, WontFix.

因此,您可以按照Paolo的建议使用打字稿或“> test.log”

上一篇:使用mininet创建网络拓扑,使ryu、ovs、主机连接


下一篇:1 mininet 简介