我想对 POX 控制器中的日志文件进行一些分析,我必须在线进行。为此,我需要该控制器在线累积的日志文件。(例如在h1 ping h2时记录信息)任何人都可以帮助我在网络信息中找到pox中的日志文件。提前致谢。
问问题
598 次
1 回答
2
您可以为交换机的统计信息添加侦听器。像这样添加它们
core.openflow.addListenerByName("FlowStatsReceived", self._handle_flowstats_received)
core.openflow.addListenerByName("PortStatsReceived", self._handle_portstats_received)
core.openflow.addListenerByName("QueueStatsReceived", self._handle_qeuestats_received)
然后在一些类方法中
def _handle_qeuestats_received (self, event):
"""
handler to manage queued packets statistics received
Args:
event: Event listening to QueueStatsReceived from openflow
"""
stats = flow_stats_to_list(event.stats)
# log.info("QueueStatsReceived from %s: %s", dpidToStr(event.connection.dpid), stats)
和
def _handle_portstats_received(self,event):
"""
Handler to manage port statistics received
Args:
event: Event listening to PortStatsReceived from openflow
"""
print event.stats
和一种流量统计方法。你会明白的。有关完整示例,请查看https://github.com/tsartsaris/pythess-SDN/blob/master/pythess.py
于 2017-04-28T21:42:08.623 回答