Monitoring Memory Usage for Linux-based EC2 Instances | Exam Study Guide

Steps to Generate Reports on Memory Usage for Linux-based EC2 Instances

Question

Your company has a set of Linux-based EC2 Instances.

You need to generate reports on the memory usage for these sets of Instances.

These dashboards need to be viewed by the Linux Administrators team continuously.

Which of the following steps would you need to implement for this requirement?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: B.

The AWS Documentation mentions the following.

A new multi-platform CloudWatch agent is available.

You can use a single agent to collect both system metrics and log files from Amazon EC2 instances and on-premises servers.

The new agent supports both Windows Server and Linux and enables you to select the metrics to be collected, including sub-resource metrics such as per-CPU core.

We recommend using the new agent instead of the older monitoring scripts to collect metrics and logs.

Option A is invalid because this is used for Windows-based instances.

Option C is invalid because this is used for API monitoring.

Option D is wrong.

There is no option available for this.

For more information on using monitoring scripts for your Linux based instances, please refer to the below URL-

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/mon-scripts.html

To generate reports on the memory usage for the set of Linux-based EC2 Instances, we need to use a monitoring solution that can collect the required metrics and display them in a dashboard. Amazon CloudWatch is a monitoring and observability service offered by AWS that can be used for this purpose.

Therefore, to meet the requirement mentioned in the question, we need to install the CloudWatch agent on the Linux Instances. This can be achieved by following these steps:

  1. Log in to the EC2 instance as a user with root privileges.

  2. Download the CloudWatch agent package for Linux from the AWS website. The package is available in rpm and deb formats for different Linux distributions.

  3. Install the CloudWatch agent package on the EC2 instance using the appropriate package manager.

  4. Configure the CloudWatch agent to collect the required metrics, such as memory usage, and send them to CloudWatch.

  5. Create a CloudWatch dashboard to display the metrics collected by the CloudWatch agent.

By following these steps, we can generate reports on the memory usage for the set of Linux-based EC2 Instances and view them in a dashboard that can be accessed by the Linux Administrators team continuously.

Option A, "Ensure that the EC2 Instance Config tool is installed on the Linux instance," is incorrect because the EC2 Instance Config tool is used to configure the EC2 instance metadata and user data, and it does not provide any monitoring capabilities.

Option C, "Use CloudTrail logs for logging all the metrics," is incorrect because CloudTrail logs are used for auditing and compliance purposes and do not provide real-time monitoring capabilities.

Option D, "Use EC2 console to get the details," is incorrect because the EC2 console does not provide real-time monitoring capabilities, and it is not suitable for generating reports on the memory usage of multiple instances.