Skip to content

Instantly share code, notes, and snippets.

@peasead
Last active March 29, 2023 03:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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
@peasead
Copy link
Author

peasead commented Oct 27, 2022

@yassermkh did you use the -f flag? That should do a force installation.

$ elastic-agent install --help

Usage:
  elastic-agent install [flags]
...
-f, --force  Force overwrite the current and do not prompt for confirmation
...

@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