Ejemplo n.º 1
0
def read_config(config_file=common.ossec_conf):
    """
    Returns the cluster configuration.

    return: Dictionary with cluster configuration
    """
    return read_cluster_config(config_file=common.ossec_conf)
Ejemplo n.º 2
0
def get_info() -> Dict:
    """
    Returns manager configuration with cluster details

    :return: Dictionary with information about manager and cluster
    """
    # get name from agent 000
    manager = Agent(id=0)
    manager._load_info_from_DB()

    # read cluster configuration
    cluster_config = read_cluster_config()

    # get manager status
    cluster_info = get_cluster_status()
    # add 'name', 'node_name' and 'node_type' to cluster_info
    for name in ('name', 'node_name', 'node_type'):
        cluster_info[name] = cluster_config[name]

    # merge manager information into an unique dictionary
    manager_info = {
        **Wazuh(common.ossec_path).get_ossec_init(),
        **{
            'name': manager.name,
            'cluster': cluster_info
        }
    }

    return manager_info