Google Associate Cloud Engineer Question 321
Select 3Google Cloud PlatformYou are tasked with deploying the Ops Agent on multiple Compute Engine instances for centralized logging and monitoring. Which steps are necessary to ensure the Ops Agent is correctly installed and configured on your instances?
- A
Download the Ops Agent package from the Google Cloud Console and manually install it on each instance.
- B
Use a startup script to automate the installation of the Ops Agent on each Compute Engine instance.
- C
Configure the Ops Agent by modifying the ops-agent-config.yaml file to specify the necessary logging and metrics.
- D
Grant the Compute Engine instances the 'Monitoring Viewer' IAM role to allow the Ops Agent to send metrics.
- E
Ensure that the Google Cloud Monitoring and Logging APIs are enabled in your Google Cloud project.
Show answer and explanation
Correct answers: B, C, E
Explanation
To successfully deploy the Ops Agent on Compute Engine instances, it is important to automate the installation using startup scripts, configure the agent properly for your logging and metrics needs, and ensure the necessary Google Cloud APIs are enabled. These steps ensure that the Ops Agent can effectively send data to the Google Cloud's monitoring and logging services without requiring excessive manual intervention or incorrect permissions.
- A. Incorrect.
Downloading the package manually is not efficient for multiple instances, especially when automation options like startup scripts are available.
- B. Correct.
Using a startup script is an efficient way to automate the installation process across multiple instances, ensuring consistency and reducing manual effort.
- C. Correct.
Modifying the ops-agent-config.yaml file is necessary to configure the Ops Agent to collect the appropriate logs and metrics specific to your needs.
- D. Incorrect.
The 'Monitoring Viewer' IAM role is not required for the Ops Agent to send metrics; it is more relevant for users accessing the data.
- E. Correct.
Enabling the Google Cloud Monitoring and Logging APIs is crucial as it allows the Ops Agent to send data to Google Cloud's monitoring and logging services.