Skip to content

Instantly share code, notes, and snippets.

@ardislu
Last active November 8, 2021 05:31
Show Gist options
  • Select an option

  • Save ardislu/ad47dd596aadaee4e87ad834a7fa2ed3 to your computer and use it in GitHub Desktop.

Select an option

Save ardislu/ad47dd596aadaee4e87ad834a7fa2ed3 to your computer and use it in GitHub Desktop.
Download, install, and start the monitoring and logging agents for a Google Compute instance.
#!/usr/bin/env bash
# NOTE: These are legacy agents that are replaced by the Ops Agent
# https://cloud.google.com/stackdriver/docs/solutions/agents/ops-agent/installation
# Download monitoring agent script, install it, and start the agent
curl -sSO https://dl.google.com/cloudagents/add-monitoring-agent-repo.sh
sudo bash add-monitoring-agent-repo.sh --also-install
sudo service stackdriver-agent start
# Download logging agent script, install it, and start the agent
curl -sSO https://dl.google.com/cloudagents/add-logging-agent-repo.sh
sudo bash add-logging-agent-repo.sh --also-install
sudo service google-fluentd start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment