def get_cached_bi_compiler() -> BICompiler: if "bi_compiler" not in g: sites_callback = SitesCallback(cmk.gui.sites.states, bi_livestatus_query) g.bi_compiler = BICompiler(BIManager.bi_configuration_file(), sites_callback) return g.bi_compiler
def __init__(self): sites_callback = SitesCallback(cmk.gui.sites.states, bi_livestatus_query) self.compiler = BICompiler(self.bi_configuration_file(), sites_callback) self.compiler.load_compiled_aggregations() self.status_fetcher = BIStatusFetcher(sites_callback) self.computer = BIComputer(self.compiler.compiled_aggregations, self.status_fetcher)
def bi_structure_fetcher(): structure_fetcher = BIStructureFetcher( SitesCallback(lambda: None, lambda: None)) yield structure_fetcher
def bi_status_fetcher(): status_fetcher = BIStatusFetcher(SitesCallback(lambda: None, lambda: None)) yield status_fetcher
def bi_searcher_with_sample_config(bi_searcher): structure_fetcher = BIStructureFetcher( SitesCallback(lambda: None, lambda: None)) structure_fetcher.add_site_data("heute", sample_config.bi_structure_states) bi_searcher.set_hosts(structure_fetcher.hosts) yield bi_searcher
def get_cached_bi_compiler() -> BICompiler: return BICompiler( BIManager.bi_configuration_file(), SitesCallback(cmk.gui.sites.states, bi_livestatus_query) )
def bi_structure_fetcher(): structure_fetcher = BIStructureFetcher( SitesCallback(lambda: None, mock_query_callback)) yield structure_fetcher
def bi_status_fetcher(): status_fetcher = BIStatusFetcher( SitesCallback(lambda: None, mock_query_callback)) yield status_fetcher