交通生成、管理和监控工具
lydian的Python项目详细描述
利比亚
LYDIAN是一个交通生成、交通管理和交通报告工具。在
它基于分布式系统原理。它使用RPC进行跨节点通信,使用本地数据库实现持久性,并使用守护程序服务实现恢复能力。在
LYDIAN有自己内置的简单TCP/UDP客户端和服务器,还提供与其他第三方工具(如IPERF)的简单集成。它将节点的集合(到达和离开需要生成流量的地方)识别为一个“集群”,并且节点可以在操作期间的任何时候附加和分离到集群。在
安装
LYDIAN作为Python包提供,可以使用pip
安装在主节点上,如下所示。在
pip install lydian
使用
LYDIAN用法简单。下面是可用的不同功能的一些示例。在
运行流量
^{pr2}$数据包捕获
fromlydian.apps.podiumimportget_podiumfromlydian.utils.ssh_hostimportHostVM_IP='1.2.3.4'# Delete any old PCAP file at endpointwithHost(VM_IP,user='root',passwd='PASSWD')ashost:host.req_call('rm -rf /tmp/test_pcap.pcap')# Also remove any local filetry:os.remove('/tmp/test_pcap.pcap')exceptFileNotFoundError:passpodium=get_podium()# Prepare the node (if not done already)podium.add_hosts(VM_IP,password=PASSWD)# Start Packet Capturepodium.start_pcap(VM_IP,pcap_file_name='test_pcap.pcap',interface='eth0')time.sleep(10)podium.stop_pcap(vm1,pcap_file_name='test_pcap.pcap')# Download file locally.withHost(VM_IP,user='root',passwd='PASSWD')ashost:host.get_file('rm -rf /tmp/test_pcap.pcap')# Run any tool on this file like tcpreplay/ wireshark on this file or simply check# that file exists.assertos.path.exists(os.path.join('/tmp','test_pcap.pcap'))
从IPERF生成流量
fromlydian.apps.podiumimportget_podiumpodium=get_podium()# Prepare the nodes (if not done already)podium.add_hosts(VM1_IP,password=PASSWD)podium.add_hosts(VM2_IP,password=PASSWD)result=podium.run_iperf3(src_ip,dst_ip)result_dict=json.loads(result)
存储库和许可证
LYDIAN是VMWARE项目的一个分支。它有自己独立的工作流和内部体系结构,因此从流和调用的角度看,不应该假设任何东西。但是,相应的许可证适用于此工具的使用。请在许可证文件中检查。在
https://github.com/gitvipin/validation-app-engine
要求
Python8.3+
分享和享受!在
- 项目
标签: