Ejemplo n.º 1
0
    def _query_peerstatus(self, nodes):
        running = self._isrunning(nodes)

        eventlist = []
        for (node, isrunning) in running:
            if isrunning:
                eventlist += [(node, "Control::peer_status_request", [], "Control::peer_status_response")]

        return events.send_events_parallel(eventlist)
Ejemplo n.º 2
0
    def _query_netstats(self, nodes):
        running = self._isrunning(nodes)

        eventlist = []
        for (node, isrunning) in running:
            if isrunning:
                eventlist += [(node, "Control::net_stats_request", [], "Control::net_stats_response")]

        return events.send_events_parallel(eventlist, config.Config.controltopic)
Ejemplo n.º 3
0
    def _query_peerstatus(self, nodes):
        running = self._isrunning(nodes)

        eventlist = []
        for (node, isrunning) in running:
            if isrunning:
                eventlist += [(node, "Control::peer_status_request", [],
                               "Control::peer_status_response")]

        return events.send_events_parallel(eventlist)
Ejemplo n.º 4
0
    def print_id(self, nodes, id):
        running = self._isrunning(nodes)

        eventlist = []
        for (node, isrunning) in running:
            if isrunning:
                eventlist += [(node, "Control::id_value_request", [id], "Control::id_value_response")]

        results = cmdresult.CmdResult()
        for (node, success, args) in events.send_events_parallel(eventlist):
            results.set_node_output(node, success, args)

        return results
Ejemplo n.º 5
0
    def print_id(self, nodes, id):
        running = self._isrunning(nodes)

        eventlist = []
        for (node, isrunning) in running:
            if isrunning:
                eventlist += [(node, "Control::id_value_request", [id],
                               "Control::id_value_response")]

        results = cmdresult.CmdResult()
        for (node, success, args) in events.send_events_parallel(eventlist):
            results.set_node_output(node, success, args)

        return results
Ejemplo n.º 6
0
    def print_id(self, nodes, id):
        results = cmdresult.CmdResult()
        running = self._isrunning(nodes)

        eventlist = []
        for (node, isrunning) in running:
            if isrunning:
                eventlist += [(node, "Control::id_value_request", [id], "Control::id_value_response")]

        if not eventlist:
            results.set_node_output(nodes[0], False, "no running instances of Bro")
            return results

        for (node, success, args) in events.send_events_parallel(eventlist, config.Config.controltopic):
            if success:
                out = "\n".join(args)
            else:
                out = args
            results.set_node_output(node, success, out)

        return results