Exemplo n.º 1
0
    def execute(self, search_result: SearchResult) -> List[ABCBICompiledNode]:
        host_re = replace_macros(self.host_regex, search_result)
        # TODO: check performance!
        host_matches, _match_groups = bi_searcher.get_host_name_matches(
            list(bi_searcher.hosts.values()), host_re)

        action_results: List[ABCBICompiledNode] = []
        for host_match in host_matches:
            action_results.append(
                BICompiledLeaf(host_name=host_match.name,
                               site_id=host_match.site_id))
        return action_results
Exemplo n.º 2
0
    def execute(self, search_result: SearchResult) -> List[ABCBICompiledNode]:
        host_re = replace_macros(self.host_regex, search_result)
        service_re = replace_macros(self.service_regex, search_result)
        host_matches, _match_groups = bi_searcher.get_host_name_matches(
            list(bi_searcher.hosts.values()), host_re)

        action_results: List[ABCBICompiledNode] = []
        service_matches = bi_searcher.get_service_description_matches(
            host_matches, service_re)
        for service_match in service_matches:
            action_results.append(
                BICompiledLeaf(
                    site_id=service_match.host.site_id,
                    host_name=service_match.host.name,
                    service_description=service_match.service_description,
                ))

        return action_results
Exemplo n.º 3
0
 def execute(self,
             search_result: SearchResult) -> List[AbstractBICompiledNode]:
     host_re = replace_macros(self.host_regex, search_result)
     host_matches, _match_groups = bi_searcher.get_host_name_matches(
         list(bi_searcher.hosts.values()), host_re)
     return [BIRemainingResult([x.name for x in host_matches])]