예제 #1
0
파일: sites.py 프로젝트: epasham/checkmk
def _update_distributed_wato_file(sites):
    # Note: we cannot access config.sites here, since we
    # are currently in the process of saving the new
    # site configuration.
    distributed = False
    for siteid, site in sites.items():
        if site.get("replication"):
            distributed = True
        if config.site_is_local(siteid):
            create_distributed_wato_file(siteid, is_slave=False)

    # Remove the distributed wato file
    # a) If there is no distributed WATO setup
    # b) If the local site could not be gathered
    if not distributed:  # or not found_local:
        _delete_distributed_wato_file()
예제 #2
0
파일: sites.py 프로젝트: sri-sysad/checkmk
def _update_distributed_wato_file(sites):
    # Note: we cannot access config.sites here, since we
    # are currently in the process of saving the new
    # site configuration.
    distributed = False
    for siteid, site in sites.items():
        if site.get("replication"):
            distributed = True
        if config.site_is_local(siteid):
            cmk.gui.watolib.activate_changes.create_distributed_wato_files(
                base_dir=Path(cmk.utils.paths.omd_root),
                site_id=siteid,
                is_remote=False,
            )

    # Remove the distributed wato file
    # a) If there is no distributed WATO setup
    # b) If the local site could not be gathered
    if not distributed:  # or not found_local:
        _delete_distributed_wato_file()
예제 #3
0
    def _save_liveproxyd_config(cls, sites):
        path = cmk.utils.paths.default_config_dir + "/liveproxyd.mk"

        conf = {}
        for siteid, siteconf in sites.items():
            proxy_params = siteconf["proxy"]
            if proxy_params is None:
                continue

            conf[siteid] = {
                "socket": siteconf["socket"],
            }

            if "tcp" in proxy_params:
                conf[siteid]["tcp"] = proxy_params["tcp"]

            if proxy_params["params"]:
                conf[siteid].update(proxy_params["params"])

        store.save_to_mk_file(path, "sites", conf)

        ConfigDomainLiveproxy().activate()