访问和监视POX控制器中的日志文件

时间:2017-04-28 08:32:16

标签: logfile sdn pox

我想对POX控制器中的日志文件进行一些分析,我必须在线进行。为此,我需要在线累积的此控制器的日志文件。 (例如,在h1 ping h2时记录信息) 任何机构都可以帮我在网络信息中查找pox中的日志文件。提前致谢。

1 个答案:

答案 0 :(得分:1)

您可以为交换机的统计信息添加侦听器。像这样添加它们

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