def install_omsagent(workspace_id, primary_key, oms_agent_install_url):
    '''
    Installing the downloaded omsagent
    :param workspace_id:
    :param primary_key:
    :return:
    '''
    print("Installing omsagent")
    omsagent_proxy_conf = os.getenv('https_proxy')
    if omsagent_proxy_conf is not None:
        print("Detected https_proxy environment variable set to " + omsagent_proxy_conf)
        command_tokens = ["sh", omsagent_file_name, "-w", workspace_id, "-s", primary_key, "-d", oms_agent_install_url, "-p", omsagent_proxy_conf]
    else:
        command_tokens = ["sh", omsagent_file_name, "-w", workspace_id, "-s", primary_key, "-d", oms_agent_install_url]
    print_notice(" ".join(command_tokens))
    install_omsagent_command = subprocess.Popen(command_tokens, stdout=subprocess.PIPE)
    o, e = install_omsagent_command.communicate()
    time.sleep(3)
    # Parsing the agent's installation return code
    output_decoded = o.decode(encoding='UTF-8')
    return_code = re.search(".*Shell bundle exiting with code (\d+)", output_decoded, re.IGNORECASE)
    if e is not None:
        handle_error(e, error_response_str="Error: could not install omsagent.")
        sys.exit()
    elif return_code is not None and return_code.group(1) != '0':
        handle_error(o, error_response_str="Error: could not install omsagent.")
        sys.exit()
    print_ok("Installed omsagent successfully.")
    return True

    Installing the downloaded omsagent
    :param workspace_id:
    :param primary_key:
    :return:
    
DataConnectors/CEF/cef_installer.py