Bitzu

Associate Cloud Engineer ยท Monitoring and alerting

The Ops Agent

Installing and configuring the Ops Agent on VMs for metrics and logs, config file, comparison with legacy agents, verifying data arrives.

Key points

  • The Ops Agent runs on a VM and sends host metrics and logs to Cloud Monitoring and Cloud Logging.
  • Install it with the add-google-cloud-ops-agent-repo.sh script and --also-install, check it with systemctl status google-cloud-ops-agent*, and customize it in /etc/google-cloud-ops-agent/config.yaml (restart after edits).

Source: https://docs.cloud.google.com/monitoring/agent/ops-agent/installation

Practice questions

Single choice

Where is the Ops Agent's user configuration file on a Linux VM?

  1. /etc/google-cloud-ops-agent/config.yaml
  2. /var/log/ops-agent/config.json
  3. /opt/google/monitoring/agent.conf
  4. /usr/local/etc/opsagent.yml
Show answer

Answer: A. /etc/google-cloud-ops-agent/config.yaml

It is /etc/google-cloud-ops-agent/config.yaml; your settings are merged with the built-in configuration.

Select all that apply

Which statements about the Ops Agent's configuration are true?

  1. By default it collects syslog files and host metrics
  2. User config takes precedence over the built-in config
  3. Changes take effect after the agent restarts
  4. Changes are applied live without any restart
  5. It reads every file under /var/log automatically
Show answer

Answer: A. By default it collects syslog files and host metrics, B. User config takes precedence over the built-in config, C. Changes take effect after the agent restarts

By default it reads syslog files and host metrics; your config overrides built-in settings and is applied after a restart. Application logs are not collected without configuration.

True or false

Right after installation, with no configuration, the Ops Agent already ships your custom application's log files to Cloud Logging.

Show answer

Answer: False

False. Defaults cover syslog files and host metrics; custom application logs need a receiver you define.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More Associate Cloud Engineer topics in this module