Skip to content

Instantly share code, notes, and snippets.

@peasead
Last active March 29, 2023 03:10
Show Gist options
  • Save peasead/33394868ddbd773c39bedde4011b4f6a to your computer and use it in GitHub Desktop.
Save peasead/33394868ddbd773c39bedde4011b4f6a to your computer and use it in GitHub Desktop.
Install the Elastic Agent on macOS systems.
#!/bin/bash -eux
# Single script to install the Elastic Agent on macOS
# Downloads the Elastic Agent and saves it to your computer in the current directory (example in Downloads, Desktop, etc.)
curl -OL https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-8.2.0-darwin-x86_64.tar.gz
# Uses the Tar command to decompress the Elastic Agent and prepare it for installation
tar zxf elastic-agent-8.2.0-darwin-x86_64.tar.gz
# Enters the Elastic Agent directory that was decompressed in the previous step
cd elastic-agent-8.2.0-darwin-x86_64
# Uses "super user do" to install the Elastic Agent, sends data to Elastic Cloud, and enrolls it in Fleet so that updates to the Agent can be managed within Kibana
sudo ./elastic-agent install -f --kibana-url=fleet-server-address --enrollment-token=enrollment-token
@yassermkh
Copy link

no didn't use that argument but I managed to make it work by answering that message with Y using :

yes | ./elastic-agent install -f --kibana-url=fleet-server-address --enrollment-token=enrollment-token

@yassermkh
Copy link

Anyone managed to grey out the elastic-agent in the login items in Ventura!?

@peasead
Copy link
Author

peasead commented Jan 24, 2023

Hey @yassermkh you might get better support on the Elastic Agent Discuss site. https://discuss.elastic.co/tags/c/elastic-stack/beats/28/elastic-agent

@charlesfair
Copy link

"Elastic Agent provides commands for running Elastic Agent, managing Fleet Server, and doing common tasks."
https://www.elastic.co/guide/en/fleet/current/elastic-agent-cmd-options.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment