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
Where is the Ops Agent's user configuration file on a Linux VM?
- /etc/google-cloud-ops-agent/config.yaml
- /var/log/ops-agent/config.json
- /opt/google/monitoring/agent.conf
- /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.
Which statements about the Ops Agent's configuration are true?
- By default it collects syslog files and host metrics
- User config takes precedence over the built-in config
- Changes take effect after the agent restarts
- Changes are applied live without any restart
- 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.
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.
