An engineering firm has launched Amazon EC2 Instance in us-east-1 & us-west-1
Metric collection is done using the CloudWatch Agent configuration file.
The operations team requires all the metrics for these instances to be sent to a central location in the us-west-1 region. What setting needs to be done with the CloudWatch Agent configuration file?
Click on the arrows to vote for the correct answer
A. B. C. D.Correct Answer: C.
Amazon CloudWatch agent configuration file consists of three sections.
Agent:This section consists of fields for configuration settings of the agent like metric frequency, region to which metric needs to be sent.
Metric: Metric section specifies custom metric to be collected.
Logs: Logs section specifies the log file which needs to be published to CloudWatch Logs.
Option A is incorrect as CWAgent is an invalid option with the CloudWatch Agent configuration file.
Options B & D is incorrect as the region field is part of the agent section & not part of the logs or metric section.
For more information on the CloudWatch agent configuration file, refer to the following URL,
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Agent-Configuration-File-Details.htmlThe correct answer for the given scenario is option C, "Specify region as us-west-1 in the region field of the agent section of the CloudWatch agent configuration file."
The CloudWatch Agent is a tool that enables you to collect operational data and logs from Amazon EC2 instances and on-premises servers. You can use the CloudWatch Agent to collect system-level metrics and application-level metrics from your instances. You can also use the CloudWatch Agent to collect logs from your instances and forward them to CloudWatch Logs.
In this scenario, the engineering firm has launched Amazon EC2 instances in two different regions: us-east-1 and us-west-1. The operations team requires all the metrics for these instances to be sent to a central location in the us-west-1 region. To achieve this, the CloudWatch Agent configuration file needs to be modified.
Option A, "Specify region as us-west-1 in the region field of the CWAgent section of the CloudWatch agent configuration file," is incorrect because the CWAgent section of the configuration file is used to configure the CloudWatch Logs agent, not the CloudWatch Agent.
Option B, "Specify region as us-west-1 in the region field of logs section of the CloudWatch agent configuration file," is also incorrect because the logs section of the configuration file is used to configure log collection, not metric collection.
Option D, "Specify region as us-west-1 in the region field of the metric section of the CloudWatch agent configuration file," is incorrect because there is no metric section in the CloudWatch Agent configuration file.
Therefore, option C, "Specify region as us-west-1 in the region field of the agent section of the CloudWatch agent configuration file," is the correct answer. The agent section of the configuration file is used to configure the CloudWatch Agent and includes a region field where the region can be specified. By setting the region to us-west-1 in this field, all the metrics collected by the CloudWatch Agent on the EC2 instances in both regions will be sent to a central location in the us-west-1 region, as required by the operations team.